Whether it is possible to assign the result of a for loop (for example, a comparison) to one variable in order to work further with the value of this variable outside the loop.
for (int i = 0; i < 100; i++) { int max=1; int a = Integer.parseInt(reader.readLine()); if (a>max) max = a; }