問題:
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));