interface A { public int getValue() }  class B implements A {  public int getValue() { return 1; }  }  class C extends B {  // insert code here  }  Which three code fragments, inserted individually at line 15, make use of polymorphism?()

A .  public void add(C c) { c.getValue(); } B .  public void add(B b) { b.getValue(); } C .  public void add(A a) { a.getValue(); } D .  public void add(A a, B b) { a.getValue(); } E .  public void add(C c1, C c2) { c1.getValue(); }

时间:2022-10-23 10:38:21 所属题库:SCJP程序员认证考试题库

相似题目