生成1000以内不重复的随机数
public void randomThird(){
int i = 1;
Random random = new Random();
int[] id =new int[3];
id[0]=random.nextInt(1000);
while(i<3){
if(id[i] != random.nextInt(1000)){
id[i] = random.nextInt(1000);
}else{
continue;
}
i++;
}
for (int j : id) {
System.out.println(j);
}
}