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();
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java