25

Specifically, with a SortedMap<Vector<String>, int> I get "dimensions expected after this (int) token." Help!

2 Answers 2

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).

Sign up to request clarification or add additional context in comments.

3 Comments

@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.
If not for the badge you would not have posted the question at all I suspect :)
@willcode…: I have not posted the question. I've just corrected the formatting.
3

Konrad is correct. Alternately, you can use the trove class TObjectIntHashMap to map Objects to primitive ints.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.