Не могу найти в чём ошибка. Или это прихоть валидатора что есть ьтолько одно решение?
package com.javarush.task.task18.task1821;
/*
Встречаемость символов
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws IOException {
FileInputStream fileInputStream = new FileInputStream(args[0]);
byte b;
byte[] bytes = new byte[128];
while (fileInputStream.available() > 0){
b = (byte) fileInputStream.read();
bytes[b]++;
}
fileInputStream.close();
for (int n = 0; n < bytes.length; n++){
if (bytes[n] > 0){
System.out.println((char)n + " " + bytes[n]);
}
}
}
}