Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

two Dan's question about thread

 
dragon ji
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Alfred Kemety
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
dragon ji
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx a lot!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic