多项选择题
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(); }
点击查看答案&解析
相关考题
