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
ADRE 2.0 Mock Test - 5 Start Test
ADRE 2.0 Mock Test - 5 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 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