Is it possible to use a primitive type (int) in as a generic type in Java?

前端 未结 2 609
陌清茗
陌清茗 2020-11-30 13:23

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

2条回答
  •  抹茶落季
    2020-11-30 14:12

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

提交回复
热议问题