Important Java Mcq 1

Which of the following statements about Java threads is correct?

a. Java threads don’t allow parts of a program to be executed in parallel.

b. Java is a single-threaded language.

c. Ready, running, and sleeping are the three states that a thread can be in during its life-cycle.

d. Every java application is not multi-threaded.

Answer:

c. Ready, running, and sleeping are the three states that a thread can be in during its life-cycle.

Explanation

Ready, running, and sleeping are the states of the thread. Ready is the state when the thread is in the waiting threads set, running means when the thread gets CPU and it moves from runnable state to running state, a sleeping state is to pause the execution of the current thread for a specified time in milliseconds.

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?