JOIN ADRE 2.0 Telegram Group

Questions Answers on Multithreading in Java - Multiple Choice Quiz

Questions
6 What is the default priority of a newly created thread?
A MIN_PRIORITY
B NORM_PRIORITY
C MAX_PRIORITY
D None of these

Answer: Option [B]

Normal priority i.e. 5

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?
A The code will fail to compile
B Nothing special will happen
C An IllegalMonitorStateException will be thrown if the wait() method is called, while the current thread does not hold the lock of the object
D The thread will be blocked until it gains the lock of the object

Answer: Option [C]
Advertisement
ADRE 2.0 Mock Test - 5 Start Test
ADRE 2.0 Mock Test - 5 Start Test

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

8 Which one of the following is a static member of Thread ?
A currentThread()
B join()
C getName()
D interrupt()

Answer: Option [A]

CurrentThread is static member method. It returns currently running thread.

9 Select the valid thread state transition?
A ready to running
B ready to waiting
C waiting to running
D running to ready

Answer: Option [A]

6 states of a new thread are new, runnable, timed waiting, waiting, blocked, terminated. A thread is run from the ready state when scheduler selects and goes to the running state.

10 What is dead thread in java ?
A A thread that is waiting for I/O operation
B A thread completed its run method
C A thread is in sleep
D None of these

Answer: Option [B]

A dead or terminated thread has completed its run() method. It can never be restarted.

ADRE 2.0 MOCK TEST

Take Mock Tests

Government Schemes Mock Test Start Test!
Political Science Mock Test – 42 Start Test
History Test – 190 Start Test
Quantitative Aptitude Test Start Test!
Trigonometry - Mock Test Start Test!
Data Interpretation - Mock Test Start Test!
General Awareness - Mock Test Start Test!
Reasoning Ability - Mock Test Start Test!
Englist(Antonyms) Mock Test 1 Start Test!
Quantitative Aptitude (Percentage) Mock Test Start Test!
Economy Mock Test 1 Unlock Test!
Books & Authors - Test 2 Unlock Test!

Chapters

Advertisement