I'm trying to rid of duplicates for my Bingo Program so I created an ArrayList and I want to remove the integer that is printed out in the loop. I think the loop I'm using is wrong but I'm not sure.
List<Integer> list = new ArrayList<Integer>();
for(int i = 1; i <= 75; i++){
list.add(i);
}
for (Integer s : list) {
Collections.shuffle(list);
System.out.println(s);
list.remove(//);
}
Set.list, there won't be any duplicates to remove.Collections.shuffle(list); for (Integer s : list) { System.out.println(s); } list.clear();. (And the last statement is only necessary if the block doesn't end right after.)