[问答题] 阅读和理解下面程序段:class Manager extends Employee public Manager(String n,double s,int year,int mo

[问答题] 阅读和理解下面程序段:class Manager extends Employee public Manager(String n,double s,int year,int mo,第1张

[问答题] 阅读和理解下面程序段: class Manager extends Employee public Manager(String n,double s,int year,int mo

[问答题] 阅读和理解下面程序段:

class Manager extends Employee

public Manager(String n,double s,int year,int month,int day)

super(n,S,year,month,day);

bonus=0;

public double getSalary()

double baseSalary=super.gerSalary();

return baseSalary+bonus;

public void setBonus(double B) bonus=b;

private double bonus;

Manager是Employee的子类,其理由是( )。

正确答案:

B

参考解析:

本题考查Java中子类的概念。Java中通过在类声明中加入extends子句来创建子类,格式为:class SubClass extens SuperClass{...

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5625613.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存