编写一个点类,利用方法输出两点的距离
public class Point {private double x,y;
public Point(double a,double b){
x = a;
y = b;
}
public double distance(double x,double y){
return Math.sqrt(x*x+y*y);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Point One = new Point(1,1);
Point Two = new Point(1,3);
System.out.println("这个点到到原点距离为:" + );//我想在这里直接输出两点距离
}
}
我这个程序应该存在问题,但是我不知道如何去修改