Specifically, with a SortedMap<Vector<String>, int>
I get "dimensions expected after this (int
) token." Help!
具体来说,使用SortedMap
2 个解决方案
#1
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).
不,这是不可能的。请改用Integer。 Autoboxing负责其余部分(即,对于大多数目的,您可以编程,就像您实际使用int一样,因为Java会自动为您转换为Integer和从Integer转换)。
#2
Konrad is correct. Alternately, you can use the trove class TObjectIntHashMap to map Objects to primitive ints.
康拉德是对的。或者,您可以使用trove类TObjectIntHashMap将对象映射到原始int。
#1
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).
不,这是不可能的。请改用Integer。 Autoboxing负责其余部分(即,对于大多数目的,您可以编程,就像您实际使用int一样,因为Java会自动为您转换为Integer和从Integer转换)。
#2
Konrad is correct. Alternately, you can use the trove class TObjectIntHashMap to map Objects to primitive ints.
康拉德是对的。或者,您可以使用trove类TObjectIntHashMap将对象映射到原始int。