JAVA Programming :: Basic Concepts - Discussion
33 / 64
Which of the following keywords indicates a thread is releasing its Object lock?
Arelease
Bwait
Ccontinue
DnotifyAll
Show Explanation
Option C is incorrect, as continue keyword has nothing to do with locks.
Option D is incorrect, as notifyAll() method can be used in Java to give the notifications for all waiting threads of a particular object that the required lock is available.
Leaving us with option B, which is the correct option, because if a thread calls wait() method on any object, it immediately releases the lock of that particular object and enters into the waiting state.
Asked In ::
Option A is incorrect, as there is no keyword in Java as release.
Option C is incorrect, as continue keyword has nothing to do with locks.
Option D is incorrect, as notifyAll() method can be used in Java to give the notifications for all waiting threads of a particular object that the required lock is available.
Leaving us with option B, which is the correct option, because if a thread calls wait() method on any object, it immediately releases the lock of that particular object and enters into the waiting state.
Read Full Answer
Report Error
Please Login First Click Here