,并且该矩形作为参数传递给方法,还有个一用于显示该矩形的定义的点的方法.生成四个矩形对该类进行测试,再将这些组合起来,最后得到
一个矩形,使其包含所有矩形.输出所有生成矩形的定义的点*/
class Point
{
private double xPoint;
private double yPoint;
Point(double xPoint,double yPoint)
{
this.xPoint=xPoint;
this.yPoint=yPoint;
}
public double getPointX()
{
return xPoint;
}
public double getPointY()
{
return yPoint;
}
/*public double getPoint()
{
return xPoint,yPoint; // 可不可以这样反回?
}*/
public void setPointX(double xPoint)
{
this.xPoint=xPoint;
}
public void setPointY(double yPoint)
{
this.yPoint=yPoint;
}
}
class Juxing
{
private Point start; //是否需要创建对象?
private Point end;
Juxing(Point start,Point end)
{
this.start=start;
this.end=end;
}
}
public class Bh1
{
public static void main(String args[])
{
}
}