Programming Languages Java Mcq
Sep 24, 2025

What happens when you call wait() method without synchronization?

Choose the correct answer:
A) Thread waits indefinitely
B) IllegalMonitorStateException is thrown
C) Method returns immediately
D) Compilation error
Detailed Explanation
IllegalMonitorStateException is thrown because wait() must be called from synchronized context (the thread must own the monitor).
Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback