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
Article and Schedule Quiz 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 FULL LENGTH MOCK TEST

Take Mock Tests

Missiles Mock Test Start Test!
SSC MTS Mock Test Start Test
IBPS CLERK MOCK TEST Start Test
SSC MTS 2022 JULY 26 Shift 1 (ENGLISH) Start Test!
SSC GD Previous Year Paper 2021 Nov 17 Shift - I (Hindi) Start Test!
SSC CGL Tier - 1 PYP 2022 April 21 Shift- 1 (ENGLISH) Start Test!
MPSC PAPER I MOCK TEST 1 (ENGLISH) Start Test!
IB Security Assistant Mock test 1 (english) Start Test!
UP POLICE CONSTABLE MOCK TEST 1 Start Test!
DELHI POLICE CONSTABLE MOCK TEST 1 (HINDI) Start Test!

Chapters

Advertisement