读书人

Java中super的运用

发布时间: 2013-08-27 10:20:47 作者: rapoo

Java中super的使用
Student(String name,int age,String school){super(name,age);this.school=school;}

?

使用时,super应放在第一句。

3.使用super的注意事项

在使用super时,super指的是调用“对象”本身,而不是指父类中看见的属性和方法。由于他指的是对象,所以不能在static的环境中使用,包括类变量(static field)和类方法(static method),static语句块。

读书人网 >编程

热点推荐