[QB]I'd say the option 2 is correct for a single-threaded application, but not for the one where many threads are started.[QB]
Are r sure Vad? Check this..
class MainThread{
public static void main(
String s[]){
Thread t1=new Thread(new A());
Thread t2=new Thread(new A());
Thread t = Thread.currentThread();
System.out.println("Current Thread:" +t);
t1.start();
t2.start();
//System.out.println("Main is done!!!");
System.out.println(t.isAlive());
}
}
class A implements Runnable{
public void run(){
try{
Thread.sleep(1000);
System.out.println(Thread.currentThread().getName());
}catch(InterruptedException ie){}
}
}
[ November 13, 2003: Message edited by: KATE MOORE ]