Hi everyone I am still relatively new to Java and I was just wondering if anyone could help me with limiting the amount of times the user can input. As you can see right now the user can input unlimited times can anyone help me limit that to "n" times?
ArrayList<Integer> al = new ArrayList<Integer>();
int check=192;
while(true){
check = input.nextInt();
if(check == 192) break;
al.add(check);
}
for (int i : al) {
System.out.print(i);
}
while(al.size() < N)