Would anyone like to explain?
package pl.codegym.task.task09.task0921;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Metoda w try-catch
*/
public class Solution {
public static void main(String[] args) {
try {
czytajDane();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void czytajDane() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> lista = new ArrayList<Integer>();
try {
for (int i = 0; i < 7; i++) {
lista.add(Integer.parseInt(reader.readLine()));
}
} catch ( NumberFormatException e) {
for (int i = 0; i < 7; i++) {
System.out.println(lista.get(i));
}
}
}
}