class Point { double x; double y; Point(double x, double y) { this.x = x; this.y = y; } String report() { return "(" + this.x + ", " + this.y + ")"; } public static void main(String[] args) { Point a = new Point(1.2, 0.6); System.out.println(a.report()); Point b = new Point(-2.3, 5.1); System.out.println(b.report()); System.out.println(a.distance(b)); System.out.println(b.distance(a)); } public double distance(Point other) { double dx = this.x - other.x; double dy = this.y - other.y; return Math.sqrt(dx * dx + dy * dy); } }