When I try to declare a Dictionary as such:
private Dictionary<String, int> map;
The compiler gives me the following error:
Syntax error on token "int", Dimensions expected after this token
But it works fine with Integer
. I'm vaguely aware that java treats int
/ Integer
differently (I come from a .NET background), but I was hoping someone could give me a full explanation on I can't use primitives in a Dictionary<>