Map generics in Java
Posted
by Amir Rachum
on Stack Overflow
See other posts from Stack Overflow
or by Amir Rachum
Published on 2010-02-26T13:21:43Z
Indexed on
2010/06/09
21:02 UTC
Read the original article
Hit count: 225
Hi all, I seem to have a bit of misunderstanding with Java Generics and I hope you can help me. I tried to create a map like so:
Map<Debater, int>
(Debater is an Interface I declared) but java complained about the int, so I did:
Map<Debater, Integer>
I suppose it's because int is not a class while Integer is, is this correct?
Also, Now I get a Debater and I need to add 1 to its value in the map. How do I do that?
© Stack Overflow or respective owner