public static void main(String[] args) {
// TODO 自动生成的方法存根
int [] arr=new int[6];
ArrayAdd array=new ArrayAdd(arr);
new Thread(array).start();
new Thread(array).start();
}
}
class ArrayAdd implements Runnable
{
private int[] in;
private int num=0;
private Random ra=new Random();
private ReentrantLock lock=new ReentrantLock();
Condition con= lock.newCondition();
/**
* @param in
*/
public ArrayAdd(int[] in) {
super();
this.in = in;
}
public void run(){