Examveda
Examveda

In Java, what is the purpose of the sleep() method in threads?

A. It terminates all threads in the program

B. It pauses the execution of the current thread for a specified duration

C. It resumes the execution of a thread

D. It terminates all threads in the program

Answer: Option B


This Question Belongs to Java Program >> Threads

Join The Discussion

Related Questions on Threads

What is a thread in Java?

A. A lightweight process that runs independently within a program

B. A data structure to store variables

C. A type of loop

D. A synchronization mechanism