Rectangle() :Point(){} Rectangle(double x,double y) :Point(x,y){}

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/04 00:24:45
Rectangle() :Point(){} Rectangle(double x,double y) :Point(x,y){}

Rectangle() :Point(){} Rectangle(double x,double y) :Point(x,y){}
Rectangle() :Point(){} Rectangle(double x,double y) :Point(x,y){}

Rectangle() :Point(){} Rectangle(double x,double y) :Point(x,y){}
估计你Rectangle和Point都是一个类,然后Rectangle继承Point
Rectangle类里面的构造函数先调用基类Point类的构造函数,因此写成
Rectangle() : Point(){}
有参构造函数一样道理
Rectangle(double x, double y) : Point(x, y){}