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(); }
正确答案:B,C,D
答案解析:有

微信扫一扫手机做题