I understand that join will ask the current running
thread to wait for some time till the thread on which join is invoked gets completed .but if join is invoked on the same thread which was started earlier.then what happens?can anybody please explain that??
Here is the code snippet
public class ProjectNew implements Runnable {
public static void main(
String[] args) throws Exception {
Projectnew n=new Projectnew();
Thread t = new Thread(n);
t.start();
System.out.print("Test 1");
t.join();
System.out.print("Test2");
}
public void run() {
System.out.println("Test 3");
}
}
Please explain how this code works??what actually happens when start and join is called??