public class Test
{
public static void main(String[] args)
{
Res res = new Res();
Producer p = new Producer(res);
Consumer c = new Consumer(res);
Thread t1 = new Thread(p);
Thread t2 = new Thread(c);
t1.start();
t2.start();
}
}
class Res
{
private String name;
private int count=1;
private boolean flag=false;