"The thread ID is a positive long number generated when this thread was created".
So, when does a Thread actually get an ID ? After new Thread() OR after start() OR after after it enters running state. To check this out i made the following code and saw some strange behaviour.
CODE "A" TO PUT : This causes a compiler error :
CODE "B" TO PUT : This works as expected :
It seems from the above code that a thread is considered to be "created" when it is in running state , right ???
What is the basis for assigning ID's to threads ? I got 9,10,11...but there are only 4 threads in my code ? So, 1,2,3, (a fourth for main) etc is what i expected. Could it give 4,5,6 or 30 , 700 ,951 ???
PS : I would be very grateful if you could attract attention to this post on my behalf.