package test;
import java.util.HashMap;
import java.util.Map;
/** * Created by suzunshou on 2016/4/8. */
public class Test11 {
public static void main(String[] args) {
String s = "0005";
Map<Character, Integer> result = getCharMaps(s);
System.out.println(result);
}
public static Map<Character, Integer> getCharMaps(String s) {
Map<Character, Integer> map = new HashMap<Character, Integer>();
for (int i = 0; i < s.length(); i++) {
Character c = s.charAt(i);
Integer count = map.get(c);
map.put(c, count == null ? 1 : count + 1);
}
return map;
}
}