完成教材P116 三 编程题 3 (设计Point类…)
题目描述:
Demo类用于测试,通过键盘输入两个点的坐标,求它们的距离
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
Point p1=new Point();
System.out.println("please input the first point's (x,y):");
p1.setX(sc.nextDouble());
p1.setY(sc.nextDouble());
Point p2=new Point();
System.out.println("please input the Second point's (x,y):");
p2.setX