GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes mock exam question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "mock exam question" Watch "mock exam question" New topic
Author

mock exam question

Stephanie Grasson
Ranch Hand

Joined: Jun 14, 2000
Posts: 347
This question is from the mock exam at www.geocities.com/SiliconValley/Screen/5046/ftest1.html.
The question says:
You have an application which executes the following line:
Thread myT = new Thread();
myT.start();
Select all of the following statements that are correct:
1. The thread myT is now in a runnable state.
2. The thread myT has the NORM_PRIORITY priority.
3. The thread will die without accomplishing anything.
4. The run method in the class where the statement occurs will be executed.
Correct answers are 1 & 3.
Why not 2?
Thanks.
Stephanie
Vivek Shrivastava
Ranch Hand

Joined: Jun 03, 2000
Posts: 277
Hi,
I think �2� is not correct because each thread gets its priority from its creating thread. So whatever priority parent thread have the new thread will get the same.
Feel free to correct me.

But here I have problem with option �1�. We all knows that start() method simply register the thread with thread scheduler and eventually thread scheduler will give a chance to this thread to run. So it is in ready to run state not in �runnable� state.
Please correct me. I am having hard time with threads today.
Your response will encourage me.

vivek


[This message has been edited by Vivek Shrivastava (edited July 21, 2000).]
vb shah
Greenhorn

Joined: Jan 09, 2008
Posts: 8
Runnable implies that "Ready to Run."
 
GeeCON Prague 2014
 
subject: mock exam question