почему не видит "list"?
на последний цикл не смотрите
package com.javarush.task.task09.task0921;
import java.io.*;
import java.util.*;
/*
Метод в try..catch
*/
public class Solution {
public static void main(String[] args) {
readData();
}
public static void readData() {
try
{
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<Integer>();
while (true)
{
list.add(Integer.parseInt(r.readLine()));
}
}
catch(NumberFormatException e)
{
for(int j = 0; j < list.size; j++){
System.out.println(list.get(j));
System.out.println("NumberFormatException! Введите целое число!");
}
}
}
}