Multiple choice technology programming languages

The methods wait() and notify() are defined in

  1. java.lang.Thread

  2. java.lang.Object

  3. java.lang.Runnable

  4. java.lang.ThreadGroup

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

wait() and notify() are defined in java.lang.Object class, making them available to all objects since every class inherits from Object. They are not in Thread, Runnable, or ThreadGroup classes.