Question: public class Point { private double x; private double y; public Point() { } public Point(double x, double y) { this.x = x; this.y =

public class Point { private double x; private double y;
public Point() { }
public Point(double x, double y) { this.x = x; this.y = y; }
public double distance(Point p) { return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y)); }
public double getX() { return x; }
public double getY() { return y; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
