Which of the following methods are defined in the Object class?
Explanation
Every Object in java has synchronisation mechanism for multithreading. You can use wait() and notify() methods on any object to synchronise your multithreaded logic. As an example

Object lock = new Object();
// later ..
synchronized (lock) {
    lock.wait(); // Will block until lock.notify() is called on another thread.
}
// Somewhere else...
synchronized (lock) {
    lock.notify(); // Will wake up lock.wait()
}
Other options are not present in Object class methods.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes