Created
May 14, 2011 13:41
-
-
Save anonymous/972218 to your computer and use it in GitHub Desktop.
operator + cannot be applied to java.lang.Object,int
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adding words to the map | |
Map<String, Integer> map = new TreeMap<String, Integer>(); | |
if (map.containsKey(word)) { | |
map.put(word, map.get(word) + 1); | |
} else { | |
map.put(word, 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment