GkSeries.com
Home
GK
ENGLISH
CURRENT AFFAIRS
APTITUDE
REASONING
BANKING
UGC NET
COMPUTER SC.
COURSES
Home
Computer Science
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?
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]
⭐ Make GKSeries Your Preferred Source on Google
Add GKSeries as Preferred Source
Next Question →