why here i can't use for loop instead of while. while(true){ int a = Integer.parseInt(reader.readLine()); list.add(a); }