Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
Java Programming
»
Threads
Which cannot directly cause a thread to stop executing?
Calling the SetPriority() method on a Thread object.
Calling the wait() method on an object.
Calling notify() method on an object.
Calling read() method on an InputStream object.
Correct Answer:
Calling notify() method on an object.
Explanation:
Option C is correct.
notify()
- wakes up a single thread that is waiting on this object's monitor.
← Previous Question
Next Question→
More Questions from
Threads
Which two of the following methods are defined in class Thread? start() wait() notify() run() terminate()
Which method registers a thread in a thread scheduler?
Which method must be defined by a class implementing the java.lang.Runnable interface?
Which of the following will not directly cause a thread to stop?
Which class or interface defines the wait(), notify(),and notifyAll() methods?
Which will contain the body of the thread?
Assume the following method is properly synchronized and called from a thread A on an object B: wait(2000); After calling this method, when will the thread A become a candidate to get another turn at the CPU?
What is the name of the method used to start a thread execution?
Which of the following will directly stop the execution of a Thread?
Which of these will create and start this thread? public class MyRunnable implements Runnable { public void run() { // some code here } }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments