JOIN ADRE 2.0 Telegram Group

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
A static
B synchronized
C private
D package

Answer: Option [B]

Two synchronized methods cannot invoke on the same object.

2 While using threads which of the following is incorrect?
A You invoke the Run method
B You implement Runnable interface
C You extend from Thread class
D You call the start method

Answer: Option [A]

Threads are instances of class java.lang and first you call start() method and after run() method is executed.

Advertisement
Article and Schedule Quiz Start Test!

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

3 What is the name of the method used to schedule a thread for execution?
A init()
B start()
C run()
D resume()

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?
A 10
B 5
C 3
D 1

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
A its sleep method is invoked
B the program terminates
C a network connection is established
D an event occurs

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.

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
Assam Direct Recruitment Test Series