Fast pseudo code. Basically the trick is that you save the characters as keys on the map, and the value is the occurrence counter for that character (key / value pair).
Map<String,Integer> charCounter = new HashMap<String,Integer>();
if(charCounter.containsKey(<your character>)){
charCounter.put(<your character>,charCounter.get(<your character>)+1);
}else{
charCounter.put(<your character>,1);
}
After you finish moving, you can print the map this way.
for(String key : charCounter.keySet()) {
System.out.println(key+" "+charCounter.get(key));
}