валидатору не нравиться мой г*вн*КОД... Пните в нужном направлении
package com.javarush.task.task18.task1816;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;
/*
Английские буквы
*/
public class Solution {
public static void main(String[] args) throws IOException{
FileReader readerFile = null;
try{
readerFile = new FileReader(args[0]);
}catch(FileNotFoundException e){}
List<Character> characterList = new ArrayList<>();
int symbol;
while((symbol = readerFile.read()) > 0){
characterList.add((char) symbol);
}
readerFile.close();
System.out.println(countEnglishLatter((ArrayList<Character>) characterList));
}
public static int countEnglishLatter(ArrayList<Character> list){
int count = 0;
for(char value : list){
if((int)value >= 65 && (int)value <=120) count++;
}
return count;
}
}
// C:\Users\Пользователь\Desktop\test.txt