MyThread t = new MyThread();
Thread x = new Thread(t);
x.start(); }
public void run(){
for(int i=0;i<3;++i){System.out.print(i+"..");}
}
}
Aruna Balasuriya
Ranch Hand
Joined: Nov 14, 2009
Posts: 44
posted
0
Aruna Balasuriya wrote:are constructor to accept Thread(Thread arg).
I made a mistake it should be as follows
are no constructor to accept Thread(Thread arg).
Chitti Ruddarraju
Greenhorn
Joined: Oct 19, 2009
Posts: 7
posted
0
could you explain clearly...
Aruna Balasuriya
Ranch Hand
Joined: Nov 14, 2009
Posts: 44
posted
0
In my code
Thrad x = new Thread(t);
Here the t is type MyThread .MyThread is a Thread as it extends class Thread. Here we are Passing a Thread object to the Thread constructor but in the Thread
class thre are no constructor to accept Thread object as a parameter. But the code compiles and runs ???