Java Threads - MCQ and Answers for Java Exam - Java Optional Questions
Questions
1
Two threads cannot simultaneously enter into the methods of the same object if the methods are
Answer: Option [B]
Two synchronized methods cannot invoke on the same object.
2
While using threads which of the following is incorrect?
Answer: Option [A]
Threads are instances of class java.lang and first you call start() method and after run() method is executed.
⭐ Make GKSeries Your Preferred Source on Google
Add GKSeries as Preferred Source
3
What is the name of the method used to schedule a thread for execution?
Answer: Option [C]
At first start() method called and then run() method is executed to schedule a thread for execution.
4
What is the default priority of a thread in Java?
Answer: Option [B]
Java threads have a priority. The highest priority of a thread is 10 and lowest priority is 1. The default priority of a java thread is 5.
5
A thread becomes not runnable when
Answer: Option [A]
A thread becomes not runnable when any of the following conditions satisfied:
(i) If sleep method is invoked
(ii) The thread calls the wait method to satisfy some specific conditions
(iv) The thread is blocking on I/O.