we knew that we can create a new thread by creating a new class thats extends thread and then to create an instance of that thread..while going through this topic i saw an example in my book which is as follows.
class NewThread extends Thread{
NewThread(){
super("demo thread");
System.out.println("child thread:"+this);
start();
}
public void run(){
try{
for(int i=5;i>0;i--){
System.out.println("child thread"+i);
Thread.sleep(500);
}
} catch(InterruptedException e){
System.out.println("child interrupted");
}
System.out.println("exiting child thread");
}
}
in this example i am able to understand all those things except the constructor part in which we are not using any instance(thread) to call start().so my question is how the start() method is called without any thread.