In a Producer & Consumer thread problem, producer thread has acquired the lock and multiple consumer threads are in wait pool, which consumer thread gets notified first, once producer thread calls notify?

Answer: The thread that it notifies depends on JVM implementation. We can’t really say which thread actually gets notified. It could be the first thread, it could be the last thread which went into the wait pool or it could be the highest priority Read more →

What is difference between BLOCKED and WAITING state in java multithreading?

Answer: Difference between blocked and waiting state of Java thread. BLOCKED state: If a thread is waiting for a lock to enter a synchronized block/method is called blocked. Note – Also, when a thread wants to re-enter a synchronized block/method after calling wait () Read more →