In a Producer Consumer scenario, one thread is a Producer and
another thread is a Consumer.
For this scenario to start working, a Consumer has to know when
the Producer has produced. In Object class, there is a wait()
method. A Consumer calls wait method to wait on Producer. The
Producer used notify() method of Object class to inform Consumer
that it has produced.
In this way the processor time between produce and consume
operations is freed due to the use of wait() and notify() methods.