首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

承继中的this和super的区别

2012-12-26 
继承中的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不能引用父类的构造函数

热点排行