欢迎来到易学考试网 易学考试官网
全部科目 > Java认证考试 > SCJP程序员认证考试

多项选择题

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(); }

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题