在 Java 中创建地图 - Create Map in Java

问题:

I'd like to create a map that contains entries consisting of (int, Point2D)我想创建一个包含由(int, Point2D)组成的条目的map

How can I do this in Java?我怎样才能在 Java 中做到这一点?

I tried the following unsuccessfully.我尝试了以下失败。

HashMap hm = new HashMap();

hm.put(1, new Point2D.Double(50, 50));

解决方案:

参考: https://stackoom.com/en/question/zrSe
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章