Hashtable with integer key in Java

后端 未结 3 700
清歌不尽
清歌不尽 2021-01-02 04:15

I\'m trying to create a Hashtable as in the following:

Hashtable> block = new Hashtable>();         


        
3条回答
  •  悲&欢浪女
    2021-01-02 04:21

    Java generics can't be instantiated with primitive types. Try using the wrapper classes instead:

    Hashtable> block = new Hashtable>();
    

提交回复
热议问题