How to correctly use HashMap?

前端 未结 6 1906
长情又很酷
长情又很酷 2021-01-04 07:28
HashMap savedStuff = new HashMap();
savedStuff.put(\"symbol\", this.symbol); //this is a string
savedStuff.put(\"index\", this.index); //this is an int
6条回答
  •  滥情空心
    2021-01-04 07:54

    HashMap savedStuff = new HashMap();
    

    Of course, you will still have to be careful to use the right type when extracting elements.

提交回复
热议问题