如何使随机数生成器不会重复数字?我试过了,但它一直给我重复的数字
public int random(int a, int b,int c,int d,int e,int f,int g,int h,int i,int j,int k,int l){
Random generator = new Random();
int choice = generator.nextInt(12) + 1;
if((choice!=b)|(choice!=c)|(choice!=d)|(choice!=e)|(choice!=f)|(choice!=g)|(choice!=h)|(choice!=i)|(choice!=j)|(choice!=k)|(choice!=l)){
a=choice;
}
else{
random(a,b,c,d,e,f,g,h,i,j,k,l);
}
System.out.println(choice);
return a;