为了账号安全,请及时绑定邮箱和手机立即绑定

Java范型一问

Java范型一问

人到中年有点甜 2019-03-05 17:15:58
Given:2. public class Organic<E> {3.     void react(E e) { }4.     static void main(String[] args) {5.         // Organic<? extends Organic> compound = new Aliphatic<Organic>();6.         // Organic<? super Aliphatic> compound = new Aliphatic<Organic>();7.         compound.react(new Organic());8.         compound.react(new Aliphatic());9.         compound.react(new Hexane());10. } }11. class Aliphatic<F> extends Organic<F> { }12. class Hexane<G> extends Aliphatic<G> { } Which, taken independently, are true? (Choose all that apply.)A. If line 5 is uncommented, compilation fails due to an error at line 7.B. If line 5 is uncommented, compilation fails due to an error at line 8.C. If line 5 is uncommented, compilation fails due to an error at line 9.D. If line 6 is uncommented, compilation fails due to an error at line 7.E. If line 6 is uncommented, compilation fails due to an error at line 8.F. If line 6 is uncommented, compilation fails due to an error at line 9. 答案是ABCD,求解释! 多谢
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 390 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信