Programming  Java  Threads

1. Two threads cannot simultaneously enter into the methods of the same object if the methods are

static synchronized private package
Comments

Share QNo: 1

2. While using threads which of the following is incorrect?

You invoke the Run method You implement Runnable interface You extend from Thread class You call the start method
Comments

Share QNo: 2

3. What is the name of the method used to schedule a thread for execution?

init() start() run() resume()
Comments

Share QNo: 3

4. What is the default priority of a thread in Java?

10 5 3 1
Comments

Share QNo: 4

5. A thread becomes not runnable when

its sleep method is invoked the program terminates a network connection is established an event occurs
Comments

Share QNo: 5

6. What is the default priority of a newly created thread?

MIN_PRIORITY NORM_PRIORITY MAX_PRIORITY None of these
Comments

Share QNo: 6

7. What will be the result of invoking the wait() method on an object without ensuring that the current thread holds the lock of the object?
while the current thread does not hold the lock of the object

The code will fail to compile Nothing special will happen An IllegalMonitorStateException will be thrown if the wait() method is called, The thread will be blocked until it gains the lock of the object

Share QNo: 7

8. Which one of the following is a static member of Thread ?

currentThread() join() getName() interrupt()
Comments

Share QNo: 8

9. Select the valid thread state transition?

ready to running ready to waiting waiting to running running to ready
Comments

Share QNo: 9

10. What is dead thread in java ?

A thread that is waiting for I/O operation A thread completed its run method A thread is in sleep None of these
Comments

Share QNo: 10

 

*Click on the QNo to display a Question.

Total Ans