Hi,
class Th extends
Thread {
public void run(){System.out.println("ABC");}
public static void main(
String a[])
{
Th th=new Th();
Thread t=new Thread(th);
t.start();//1
t.run();//2
}
}
output is ABC
ABC
I understood that at line 1 the run() method of the Runnable object th is called. But why is the output of line 2 ABC...should that be calling the run() method(which will not print anything) of Thread class?
Thanks.