*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes please eplain this thread question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "please eplain this thread question" Watch "please eplain this thread question" New topic
Author

please eplain this thread question

alwin das
Ranch Hand

Joined: Sep 23, 2005
Posts: 32
1] Are the following statements true?


1)A timeout argument can be passed to join methods
2)join methods needs the InterruptedException in its throws clause like sleep and wait?
3)If execution of the synchronised block completes abruptly, then the lock is released
4)The Thread.sleep method causes the thread to move to the Not-Runnable state
5)Some implementations of the Thread.yield method will not yield to a thread of lower priority


2]if the thread calling wait() method doesnt own the lock then illegalMonitorStateEception is thrown which is unchecked

so does it mean it is runtime eception so can we conclude that
wait() throws runtime exception

3)what is non runnable state? with respect to following question
Which of the following thread state transitions model the lifecycle of a thread?

a. The Dead state to the Ready state
b. The Ready state to the Not-Runnable state
c. The Ready state to the Running state
d. The Running state to the Not-Runnable state
e. The Running state to the Ready state
f. The Not-Runnable state to the Ready state
g. The Not-Runnable state to the Running state



4)
why the run method of class A is called and not of class B

why the o/p is A and not B?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

alwin, what do you think about these questions? (Hint: Many of them can be quickly verified by checking the API.)


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: please eplain this thread question
 
Similar Threads
Section 7 mock test questions
Threads execution is disorder
Threads Notes for Exams
thread question
Threads and Synchronization examples