import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class SquareKaro { public static void main(String[] args) { BlockingQueue number = new LinkedBlockingQueue<>(); BlockingQueue result = new LinkedBlockingQueue<>(); Squarer mysquarer = new Squarer(number, result); mysquarer.start(); try { System.out.println("Hey another process, give me square of => 54"); number.put(54); System.out.println(result.take()); } catch(Exception e) { e.printStackTrace(); } } }