class Newthread implements Runnable{
String name;
Thread t;
Newthread (String threadname)
{
name=threadname;
t=new Thread(this,name);
System.out.println(t);
t.start();
}
public void run()
{
try
{ for(int i=5;i>0;i--)
{
System.out.println(i);
Thread.sleep(1000);
}
}catch(--------){
--------}
}
}
class A{
public static void main(){
new Newthread("one");
new Newthread("two");
new Newthread("three");
try{
Thread.sleep(10000);
}catch(){}
}
in this code after calling constructor, why not start function starts executing rather than going back to main class(A here)? why the statement t.start(); not jump to run function? it first goes to main class and then come back and start executing run function of all three. why it is so ? explain me please i m not getting it. :-(