Can anybody could help how to cope with counting the letters? Does A is the same as a? Maybe the best solution is to convert to ASCII?
package pl.codegym.task.task18.task1816;
/*
ABC
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class Solution {
public static void main(String[] args) throws FileNotFoundException, IOException {
FileInputStream fis = new FileInputStream(args[0]);
HashMap<Character, Integer> alfabet =new HashMap<Character, Integer>();
//Character[] tablicaAlfabetu = new Character[]{'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z'};
while (fis.available()>0){
Character litera = Character.toLowerCase((char)fis.read());
Integer liczba = alfabet.get(litera);
alfabet.put(litera, liczba++);
}
fis.close();
for(Map.Entry<Character,Integer> a: alfabet.entrySet()){
System.out.println(a.getKey() + " : " + a.getValue());
}
}
}