承继中的this和super的区别

继承中的this和super的区别class Person{int ageint heightvoid eat(){}void sleep(){}Person(){} //父

继承中的this和super的区别

class Person{int age;int height;void eat(){}void sleep(){}Person(){} //父类构造方法}class Student extends Person{int score;void study(){}Student(){}//子类构造方法}




注意:this不能引用父类的构造函数