Ensure Main Method Exit at the End

We can achieve this by isAlive() and join() methods of Thread class. isAlive() is not great at doing this task. So, we will be using join() method. Threadd class — implements Runnable :  class Threadd implements Runnable{Thread t;String name; Threadd(){name = “how”;t = new Thread(this,name);System.out.println(“This is thread”);t.start();} public void run() {for(int i=0;i<20;i++){System.out.println(“This is run method”);try{Thread.sleep(100);}catch(InterruptedException … Read moreEnsure Main Method Exit at the End

Java brief Intro

Java is a OOP (object oriented language). Which means we see ‘who is effected’ instead of ‘what is happening’. Java was conceived by : James Gosling Patrick Naughton Chris Warth Ed Frank Mike Sheridan at Sunmicrosystems inc. in 1991. Took 18 Months for first version At the start java’s name was oak Renamed to java … Read moreJava brief Intro