It's not a secret anymore!*
The moose likes Mock Exam Errata and the fly likes The Question in The Mock Exam Confued Me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "The Question in The Mock Exam Confued Me" Watch "The Question in The Mock Exam Confued Me" New topic
Author

The Question in The Mock Exam Confued Me

Andrew Cheng
Greenhorn

Joined: Jan 09, 2002
Posts: 12
which two cannot directly cause a thread to stop executing?
A. exiting from a synchronized block
B. calling the wait method on an object
C. calling the notify method on an object
D. calling a read method on an InputStream object
E. calling the setPriority method on a thread object
The answer is "CE"
But I think the answer is "AC".Because I think "exiting from a synchronized block" can do nothing to stop a thread.Am I right?
Shivaji Marathe
Ranch Hand

Joined: Jan 11, 2002
Posts: 203
I think the answers are A, C and E, although the option E is ambiguous.
It does not say if setPriority is called on the current thread or another thread, nor does it say if the priority is increased or decreased.
If you found this in a mock exam, you can always send and email to the author.
HTH
 
Consider Paul's rocket mass heater.
 
subject: The Question in The Mock Exam Confued Me
 
Similar Threads
question about thread
What can cause a thread to become non-runnable?
Thread
Which two CANNOT directly cause a thread to stop executing?
Question on exercise about Thread(2)