Threads - Study Mode
[#56] In Java, what is the difference between a thread's priority and its thread group's maximum priority?
Correct Answer
(A) A thread's priority determines its relative importance, while the thread group's maximum priority sets an upper limit on thread priorities
[#57] How can you check if a thread is still running in Java?
Correct Answer
(D) By using the isAlive() method
[#58] In Java, can you force a thread to stop its execution using the stop() method?
Correct Answer
(C) Yes, but it is discouraged because it can leave the program in an inconsistent state
[#59] What is the purpose of the yield() method in Java threads?
Correct Answer
(B) It suggests that the current thread should yield to other threads with the same priority
[#60] In Java, what is the purpose of the interrupt() method in threads?
Correct Answer
(C) It interrupts the normal execution of a thread, causing it to throw an InterruptedException