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. None of These
Answer: Option B
Join The Discussion