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

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/22 20:32:45
Rectangle():Point(){}Rectangle(doublex,doubley):Point(x,y){}Rectangle():Point(){}Rectangle(doublex,d

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){}