There are actually two threads in your program 1. Test, that is your own thread. 2. From Thread class.
In the Test class's Constructor, you start() that thread. and in your main method, your pass this(you Test object) as target to the Thread class thread, and start it.
If you don't extends Thread class and implements Runnable as bellow, you'll get Compilation error, because Test class don't have start() method.
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
That's not anonymous Thread, that is the Thread the programmer has created(The Test Thread)! The start() method of that thread is inherited from Parent Thread class, which the programmer extends. Check it with the invocation of run() method of this thread.
Joined: Sep 12, 2009
If it is not Anonymous then how would you control it.....I mean you dont have any reference to it.....except with the JVM whic calls run on it .