Certification tests Certification training Certification tests mcse ccna a+
Practice Tests CCNA MCSE A+ Network+           
  IT Certification Practice Exams   HOME  | Cisco  | CompTIA  | CheckPoint | CIW | Microsoft | Books | Bootcamp |  Buy Now!

Java Certification: SCJP - Sun Certified Java Programmer Exam 

Practice Questions: Exam SCJP 1.6
Declaration and Access Control

 

Home                                                                       Up         Previous    Next

Q8. A monitor called mon has 5 threads in its waiting pool; all these waiting threads   have the same priority. One of the threads is thread1. How can you notify thread1   so that  it alone moves from Waiting state to Ready State?

 

A.     Execute notify(thread1); from within synchronized code of mon.

B.     Execute mon.notify(thread1); from synchronized code of any object.

C.     Execute thread1.notify(); from synchronized code of any object.

D.     Execute thread1.notify(); from any code(synchronized or not) of any object.

E.     You cannot specify which thread will get notified.

Correct Answer: E

 

Explanation:

E is correct, when you call notify() on a monitor, you have no control over which waiting thread gets notified.

 

 

Home                                                                                                          Up       Previous    Next

Email: test@simulationexams.com