public class Test{
Random r = new Random();
int[] arr = [0,0,0,0,0,0,0,0,0,0];
String fourstr ="";
int num=0;
while(fourstr.length!=4){
num = r.nextInt(10);
if(arr[num]==0){
fourstr+=num;
arr[num]=1;
}
}
public class Test{
Random r = new Random();
int[] arr = [0,0,0,0,0,0,0,0,0,0];
String fourstr ="";
int num=0;
while(fourstr.length!=4){
num = r.nextInt(10);
if(arr[num]==0){
fourstr+=num;
arr[num]=1;
}
}