在 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章