Which of the given methods are of Object class?
A. notify(), wait( long msecs ), and synchronized()
B. wait( long msecs ), interrupt(), and notifyAll()
C. notify(), notifyAll(), and wait()
D. sleep( long msecs ), wait(), and notify()
Answer:C
Which of the given methods are of Object class?
A. notify(), wait( long msecs ), and synchronized() B. wait( long msecs ), interrupt(), and notifyAll() C. notify(), notifyAll(), and wait() D. sleep( long msecs ), wait(), and notify()
Explanation: The notify(), notifyAll(), and wait() are the methods of the Object class. The notify() method is used to raise a single thread that is waiting on the object’s monitor. The notifyAll() method is similar to the notify() method, except that it wakes up all the threads that are waiting on the object’s monitor. The wait() method is used to make a thread to wait until another thread invokes the notify() or notifyAll() methods for an object.