Code example for SynchronousQueue

0
 
public class Application { 
	public static final String MESSAGE_DONE = "Done";
 
	public static void main(String... args) {
		BlockingQueue<String> queue = new SynchronousQueue<>();
		(new Thread(new Producer(queue))).start();
		(new Thread(new Consumer(queue))).start();
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE