Threads Questions and Answers
Practice ModeShowing 10 of 15 questions
Q11
Which method registers a thread in a thread scheduler?
Answer: Option C
Q12
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?
Answer: Option A
Q13
Which of the following will not directly cause a thread to stop?
Answer: Option A
Q14
Which class or interface defines the wait(), notify(),and notifyAll() methods?
Answer: Option A
Q15
public class MyRunnable implements Runnable
{
public void run()
{
// some code here
}
}
which of these will create and start this thread?
Answer: Option C