public class Point extends Pair{ public Point (int xx, int yy){ super (xx,yy); } public String toString(){ return "Point[" + x + "," + y + "]"; } public double distance(){ return Math.sqrt(x*x + y*y); } public double distance(Point p){ return Math.sqrt((x-p.x)*(x-p.x) + (y-p.y)*(y-p.y)); } }