不定项选择题 给出下面的代码:
   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();
【正确答案】 D
【答案解析】子类可以重写父类的方法,在子类的对应方法或其他方法中调用被重写的方法需要在该方法前面加上“super.”进行调用,如果调用的是没有被重写的方法,则不需要加上“super.”,直接写方法就可以。这里要指出的是Java支持方法的递归调用,因此答案A和B在语法上是没有错误的,但是不符合题目代码中说明的要求:即做和父类的方法中相同的事情,打印名字和部门,严格来说也可以选A和B。