Ok I simply may have been at all this for too long today, but I cannot get this to work in anyway whatsoever. I've tried re-writing code based on previous help questions/answers and none of it has worked. not even making changes marked "solution". so I wrote it this way which I thought would be fine but it still does not meet the final requirement.
package com.codegym.task.task09.task0921;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Method in a try-catch
*/
public class Solution {
public static void main(String[] args) {
readData();
}
public static void readData() {
ArrayList<Integer> list = new ArrayList<>();
try{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int x;
while (true){
x=Integer.parseInt(reader.readLine());
list.add(x);
System.out.println(list);
}
}
catch (Exception e){
System.out.println(e);
}
//write your code here
}
}