← Back to Java

notify() vs notifyAll()

Javajava

The Question

What is the difference between notify() and notifyAll() in Java?

What a Strong Answer Covers

  • notify() wakes one waiting thread arbitrary
  • notifyAll() wakes all waiting threads
  • notify() can cause starvation
  • notifyAll() safer for multiple conditions
  • both require synchronized context

Related Questions

  • JVM vs JRE vs JDK
  • Java Platform Independence
  • How JVM Works
  • Main Features of Java
  • public static void main

Practice This Question

Get AI-graded feedback on your answer with follow-up probes on weak points.

Take the Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout