public static void main(String[] args) {
int[] arr = new int[5];
Random ran = new Random();
for (int i = 0; i < arr.length; i++) {
int random = ran.nextInt(5) + 1;
arr[i] = random;
for (int j = 0; j < i; j++) {
if (arr[i] != arr [j]) {
}else {
i--;
}
}
}
for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i]+" ");
}
}