Specifically, with a SortedMap<Vector<String>, int>
I get "dimensions expected after this (int
) token." Help!
Asked
Active
Viewed 1.4k times
2 Answers
35
No, this is not possible. Use Integer
instead. Autoboxing takes care of the rest (i.e. for most purposes you can program as if you had actually used int
because Java converts to and from Integer
automatically for you).

Konrad Rudolph
- 530,221
- 131
- 937
- 1,214
-
6@willcode…: You figured me out. :-/ If not for the badge, I would have given a wrong, thoroughly misleading answer that would have led the OP on a merry goose chase through the internet. Now, quick, get off the Internet. It's dangerous out here. – Konrad Rudolph Jan 06 '09 at 19:56
-
If not for the badge you would not have posted the question at all I suspect :) – willcodejavaforfood Jan 19 '09 at 16:53
-
1@willcode…: I have *not* posted the question. I've just corrected the formatting. – Konrad Rudolph Jan 19 '09 at 18:37
3
Konrad is correct. Alternately, you can use the trove class TObjectIntHashMap to map Objects to primitive ints.

Craig P. Motlin
- 26,452
- 17
- 99
- 126