1、数组:int[] point = new int[]{1, 2}; 2、Point 类:Point p = new Point(1, 2); 3、Map:Map<String, Integer> p = new HashMap<String, Integer>();p.put("x", 1);p.put("y", 2); 4、自定义类:class Point2D {public int x, y; public Point2D(int x, int y){this.x = x; this.y = y;}}总之方法多得很。
2、Point 类:Point p = new Point(1, 2);
3、Map:Map<String, Integer> p = new HashMap<String, Integer>();p.put("x", 1);p.put("y", 2);
4、自定义类:class Point2D {public int x, y; public Point2D(int x, int y){this.x = x; this.y = y;}}总之方法多得很。