多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

public class Employee{       private String name;  public Employee(String name){           this.name = name;      }  public void display(){         System.out.print(name);      } }  public class Manager extends Employee{       private String department;  public Manager(String name,String department){          super(name);  this.department = department;  }  public void display(){  System.out.println(super.display()+”,”+department);      } }  执行语句new Manager(“smith”,”SALES”)后程序的输出是哪项?() 

  • A、 smith,SALES
  • B、 null,SALES
  • C、 smith,null
  • D、 null,null
  • E、 编译错误
正确答案:E
答案解析:
进入题库查看解析

微信扫一扫手机做题