What is the purpose of the `notify()` method in interthread communication?
`notify()` is used to wake up a single thread that is waiting on the same object's lock, allowing it to continue execution.
Great! You've got it right. `notify()` helps wake up one of the waiting threads, allowing it to resume execution.
Can you explain how `notifyAll()` works differently from `notify()` when multiple threads are waiting?