Hashtable with integer key in Java

后端 未结 3 712
清歌不尽
清歌不尽 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:27

    You can use Integer instead of int and if you're using java 1.5+ the boxing/unboxing feature will make your life easy when working with it.

    Hashtable block = new Hashtable();
    

提交回复
热议问题