public class Point
{
protected int x,y;
Point(int a,int b){setPoint(a,b);} //构造方法
public void setPoint(int a,int b){x=a;y=b;}
public int getX(){return x;}
public int gety(){return y;}
}
public class Line extends Point
{
protected int x,y,endX,endY;
Line(int x1,int y1,int x2,int y2){setLine(x1,y1,x2,y2);} //构造方法
public void setLine(int x1,int y1,int x2,int y2){x=x1;y=y1;endX=x2;endY=y2;}
public int getX(){return X;}
public int getY(){return Y;}
public int getendX(){return endX;}
public int getendY(){return endY;}
public double length(){
return Math.sqrt((endX-x)*(endX-x) + (endY-y)*(endY-y));
}
}
public class Circle extends Point
{
protected int radius;
Circle(int a,int b,int r){
super(a,b);
setRadius(r);
} //构造方法
public void setRadius(int r){radius=r;}
public int getRadius(){return radius;}
public double area(){return 3.14159*radius*radius;}
}