This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes two Dan's question about thread 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 "two Dan Watch "two Dan New topic
Author

two Dan's question about thread

dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
1.Which of the following are true?
g. No restriction is placed on the number of threads that can enter a synchronized method.
question: why this answer is wrong?
2.Which of the following will force a thread to move into the Not-Runnable state?
c. Thread.join method.
question: who can tell me why this answer is right?


scjp 1.4<br />challenge haven't limit!
Alfred Kemety
Ranch Hand

Joined: Aug 14, 2002
Posts: 279
About Thread.join() please check this post Salient join() characteristics
About the first one, Not more than one thread can access synchronized methods since the Thread has to own the monitor of the object the method belongs to, and since not 2 threads can own the monitor of an object then there ARE restrictions on this issue.


Alfred Raouf - Egypt - SCJP 1.4<br />Kemety.equals(Egyptian) // returns true
dragon ji
Ranch Hand

Joined: Oct 31, 2002
Posts: 110
thanx a lot!
 
Consider Paul's rocket mass heater.
 
subject: two Dan's question about thread