public static int[] uniqueRandomElements (int size) { int[] a = new int[size]; for (int i = 0; i < size; i++) { a[i] = (int)(Math.random()*10);
int[] a = new int[20]; for (int i = 0; i < size; i++) { a[i] = (int) (Math.random() * 20); for (int j = 0; j < i; j++) { if (a[i] == a[j]) { a[i] = (int) (Math.random() * 20); //What's this! Another random number! i--; break; } } }