Skip to content

Instantly share code, notes, and snippets.

Created May 14, 2011 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/972218 to your computer and use it in GitHub Desktop.
Save anonymous/972218 to your computer and use it in GitHub Desktop.
operator + cannot be applied to java.lang.Object,int
// 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