我想创建一个 map
,其中包含由 (int, Point2D)
如何在 Java 中做到这一点?
我尝试了以下失败。
HashMap hm = new HashMap();
hm.put(1, new Point2D.Double(50, 50));
最佳答案
Map <Integer, Point2D.Double> hm = new HashMap<Integer, Point2D>();
hm.put(1, new Point2D.Double(50, 50));
关于java - 在 Java 中创建 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14743516/