hi ranchers............a few questions in k&b in
thread self
test are having code like this:
class mythread extends Thread
{
public void run()
{
//this run() is not called
}
}
class abc
{
public static void main(
String arg[])
{
mythread t=new mythread(){ //<-i am on getting this brackets role here
public void run()
{
//this run is called
}
};//<-i am on getting this brackets role here
t.start();
}
}
IN my mind these questions are coming:
1.what the work that braket and at the end of the braket ; is used. CAN ANY ONE TELL ME WHAT IS THE BEHAVIOUR OF SUCH BRAKETS.
2.why the run in main is called even the object is of "mythread class"
,and it has overridden the run() so why the main() block's run is executing.
help me out guys!! just one month is left for my exam!!