hashTable?
hashSet?
hashMap?
Map<String,Integer> oldMap = new HashMap<String, Integer>();
oldMap.put("one", 1);
oldMap.put("two", 2);
oldMap.put("three", 3);
oldMap.put("four", 4);
Map<String,Integer> newMap = new HashMap<String, Integer>();
for (Map.Entry<String, Integer> mapVal : oldMap.entrySet()) {
int i = mapVal.getValue();
newMap.put(mapVal.getKey(), ++i);
}
//獲得新的newMap