This post originated from an RSS feed registered with Java Buzz
by Java Guru.
Original Post: How to solve Producer Consumer problem in Java using wait and notify method
Feed Title: Java Interview Questions and Answers with Example
Feed URL: http://singletonjava.blogspot.com/feeds/posts/default?alt=rss
Feed Description: Blog for Java techniques and Programming Tutorials, Examples, Design Patterns, Interview Questions and Answers, Cloud, Virtualization, XML, Docker, Multithreading, Collection, Error and Exception, Java Singleton Design Pattern, Docker Interview Questions, String, Executor Service, Array List, TreeSet, HashMap, Concurrency
Producer Consumer problem can be easily solved by using just wait and notify method using inter-thread communication where one thread is used to produce and another thread is used to consume. Here the wait and notify method will be used for inter-thread communication to notify other party (Producer by Consumer thread and vice-versa).
To solve this problem, I have used the ArrayList as shared