in JAVA by (20.8k points)
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()

1 Answer

0 votes
by (20.8k points)

(c) notify(), notifyAll(), and wait()

Reason: 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.

Related questions

0 votes
asked Apr 10, 2021 in JAVA by Robindeniel (20.8k points)