Hi,
I found a question on Threads from a mock exam.
class A extends
Thread {
private int i;
public void run() {i = 1;}
public static void main(
String[] args) {
A a = new A();
try{
a.start();
a.join(); //Line 1
System.out.print(a.i);
}
catch(Exception ex){}
}}
The out put is 1.But if I comment Line 1,the out put is 0.
Can some one explain what difference it makes when a call to join() is made.
Thanks
Chandrasekhar S.