Win a copy of Functional Design and Architecture this week in the Functional programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

mock exam question

 
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Runnable implies that "Ready to Run."
 
reply
    Bookmark Topic Watch Topic
  • New Topic