@@ -0,0 +1,1160 @@
+package producerConsumer;%0A%0Aimport java.util.Queue;%0Aimport java.util.concurrent.ArrayBlockingQueue;%0A%0Apublic class Main %7B%0A    public static void main(String%5B%5D args) %7B%0A        Integer%5B%5D integers = new Integer%5B5%5D;%0A        for (int i = 0; i %3C 5; i++) %7B%0A            integers%5Bi%5D = i;%0A        %7D%0A%0A        Queue%3CInteger%3E sharedQueue = new ArrayBlockingQueue%3C%3E(10);%0A%0A        Producer%3CInteger%3E producer = new Producer(sharedQueue, integers);%0A        Thread prodThread = new Thread(producer, %22Producer%22);%0A%0A        Consumer%3CInteger%3E consumer = new Consumer(sharedQueue);%0A        Thread consThread = new Thread(consumer, %22Consumer%22);%0A        prodThread.start();%0A        consThread.start();%0A%0A        try %7B%0A            Thread.currentThread().sleep(3000);%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        producer.setSrc(new Integer%5B%5D %7B10,30,40,50,60,70,80,90,100%7D);%0A%0A        try %7B%0A            Thread.currentThread().sleep(3000);%0A        %7D catch (InterruptedException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        for (Integer i : consumer.getResult()) %7B%0A            System.out.println(i + %22 - result%22);%0A        %7D%0A    %7D%0A%7D%0A

add producer-consumer pattern