- 2
- 0
- 约2.45万字
- 约 82页
- 2017-08-14 发布于河南
- 举报
子类隐含调用父类的构造方法 如果Employee类定义两个构造方法 class Employee { String name ; int age ; float salary ; Employee() { } ; //无参数构造方法 Employee(String n,int a,float s){ // 3个参数的构造方法 name = n ; age = a ; salary = s; } ... 因为Employee类定义了一个无参数的构造函数,前页Manager类的构造方法出现的问题就解决了。 域的继承与扩充 继承 扩充 方法: upSalary getInfo 属性: name age salary Employee类 方法: upSalary setAllowance getInfo 属性: name age salary allowance Manager类 方法: upSalary setAllowance getInfo setTel 属性: name age salary allowance telephone department Director类 方法的继承、扩充与覆盖 继承 扩充 覆盖 方法: upSalary getInfo 属
原创力文档

文档评论(0)