问题:
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));