Here are the problems in your code -
#1 - as per condition you need to "create a FileInputStream using the line read from the console." which cant be performed as your code is
#2 - try to read data from created fileInputStream variable and get the value in string variable and try checking on it for null instead of converting read string in Integer variable and checking on it. Please modify line number 25 in your code to something like this
FileInputStream input =newFileInputStream(filename);
reader =newBufferedReader(newInputStreamReader(input));ArrayList<Integer> list =newArrayList<Integer>();String data =null;while((data = reader.readLine())!=null){
list.add(Integer.parseInt(data));}
#3 - and lastly you need to close the input stream
Hey @Abhishek Rangari you dont need to write
String data = null on line 5 as it is redundant
because default value for a string is null so you dont need to initialize it to null just declare it and leave it like
String a; this.