GkSeries.com

Q.

What will be the result of invoking the wait() method on an object without ensuring that the current thread holds the lock of the object?

[A] The code will fail to compile
[B] Nothing special will happen
[C] An IllegalMonitorStateException will be thrown if the wait() method is called, while the current thread does not hold the lock of the object
[D] The thread will be blocked until it gains the lock of the object
Answer & Explanation
Option: [C]

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

Please share this page

Click Here to Read more questions

Teacher Eligibility Test