• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in JAVA by
Q:
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

(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 9 in JAVA by Robindeniel
0 votes
asked Apr 8 in JAVA by SakshiSharma
...