When I print out the values if there is new line "println" verification says that there are too many, if I use "print" says there are too few. DFQ?
package com.codegym.task.task13.task1326;
/*
Sorting even numbers from a file
*/
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
public class Solution {
public static void main(String[] args) {
try {
BufferedReader uin = new BufferedReader(new InputStreamReader(System.in));
String s = uin.readLine();
FileInputStream fis = new FileInputStream(s);
ArrayList<Integer> list = new ArrayList<>();
while (fis.available() > 0) {
int x = fis.read();
if (x % 2 == 0)
list.add(x);
}
uin.close();
fis.close();
Collections.sort(list);
for (int i = 0; i < list.size(); i++) {
System.out.println(list.get(i));
}
} catch (IOException e) {
}
}
}