Hi there,
I have a HashMap that I'm using in Processing and I'd like to increment the value in the map. I Google'd it and it showed me that the following code is correct:
if (colors.containsKey(ckey))
{
colors.put(ckey, colors.get(ckey) + 1);
} else {
colors.put(ckey, 1);
}
I keep getting:
The operator + is undefined for the argument type(s) Object, int
I'm not a Java coder but the reference says it returns an Object...do I have to use a .getValue() method on it to extract the int?
Maybe I'm doing something else wrong? Hmmm.
Regards.