I let the main thread executed a full period stopping at line 19 again. Of course,
the sub thread execute some number of statements and stopped inside the sleep() native
method.
Then I listed all threads and want to find a way to switch the command prompt to
the sub thread to check local variable there. The manual says to use "thread n", where
n is the thread index to change the current thread. But where can I to get the thread index?
I tried to search the Web and did not get any clear answer.
However I got the answer from the output of the threads output. The thread index was
listed as a hex number next to the class name. For example, "(PrimeNumberSeeker)0x118" means
thread 0x118 = 280.
So I used "thread 280" to switch to the sub thread as the current thread. Notice that
the command prompt changed.
The first "list" command did not work, because the sub thread was stopped inside the "sleep()"
method. The "step out" command continued the execution just enough to finish "sleep()" and back
to the caller, run().