//hashMap的遍历方式1
Iterator<Entry<Character, Integer>> iter = map.entrySet().iterator();
char ch;
while(iter.hasNext()){
Map.Entry<Character, Integer> entry = (Map.Entry<Character, Integer>) iter.next();
if(entry.getValue()==1) {
ch = entry.getKey();
return ch;
}
}
//方式2
for(Map.Entry<Character, Integer> entry:map.entrySet()){
if(entry.getValue()==1)return entry.getKey();
}