问题详情

答题翼 > 问答 > 大学本科 > 正文
目录: 标题| 题干| 答案| 搜索| 相关

给出下面的代码: class Person{ String name department ; public void printValue(){ System.out.prin


给出下面的代码:

class Person{

String name,department ;

public void printValue(){

System.out.println("name is"+name);

System.out.println("department is "+department);

}

}

public class Teacher extends Person{

int salary;

public void printValue(){

//doing the same as in the parent method printValue()

//including print the value of name and department.

System.out.printin("salary is"+salary);

}

}

下面的______表达式可以加入printValue()方法的”doing the same as…”部分.

A.printValue(); B.this.printValue();

C.person.printValue();D.super.printValue();

参考答案
您可能感兴趣的试题