My "Mentor" says I have too few lines.... BUT if I write "System.out.printLN(list)" I have too much lines XD
Can someone please help ty
package com.codegym.task.task13.task1326;
/*
Sorting even numbers from a file
*/
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
public class Solution {
public static void main(String[] args) throws IOException {
//write your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
InputStream inputStream = null;
BufferedInputStream buffer = null;
try{
inputStream = new FileInputStream(reader.readLine());
buffer = new BufferedInputStream(inputStream);
while (buffer.available()>0){
int i = (int)buffer.read();
if (i%2==0){
ArrayList<Integer>list = new ArrayList<>();
list.add(i);
Collections.sort(list);
System.out.print(list);
}else{
}
}
}catch (Exception e){
}
inputStream.close();
buffer.close();
reader.close();
}
}