I have generate a random number from 1-100 but not the duplicate number will appear(eg.if 10 comes ones then it will not come again.) (this is not working)
final Random random = new Random();
ArrayList<Integer> arrayList = new ArrayList<Integer>();
while (arrayList.size() < 6) { // how many numbers u need - it will 6
int a = random.nextInt(91)+1; // this will give numbers between 1 and 90.
if (!arrayList.contains(a)) {
arrayList.add(a);
}
}
and how can I used that generated appear at the bottom of the screen so that what number is done user must know If 1-100 all the number is done then no number is generated
Can anyone help me with this