摘要:
类继承格式class Manager extends Employee{ //添加方法和域 public void setBonus(double b) { bonus = b; } public getSalary() { double baseSalary = super.getSalary(); return baseSalary + bonus; } private double bonus;} java继承采用extends关键字,代替了c++里面的冒号,在java中,所有继承都是公有继承,没有C++中的私有继... 阅读全文