当前位置:SCJP程序员认证考试题库

问题:

[单选]

11. public void addStrings(List list) { 
12. list.add(”foo”); 
13. list.add(”bar”); 
14. } 
What must you change in this method to compile without warnings?() 

A .  add this code after line 11: list = (List) list;
B .  change lines 12 and 13 to: list.add(”foo”); list.add(”bar”);
C .  change the method signature on line 11 to: public void addStrings(List< extends String> list) {
D .  change the method signature on line 11 to: public void addStrings(List< super String> list) {
E .  No changes are necessary. This method compiles without warnings.

简述健康教育项目评价的种类。 在不均匀磁场中,作用在磁性矿粒上的磁力大小与不均匀程度() 成正比。 成反比。 无关。 不定性关系。 保险规划的第一步是() 确定保险需求。 选择保险产品。 确定保险金额。 确定保险期限。 规范性文件的撰拟要求是什么? 有一台正在运行中的气阀单座阀,老是关不死,一般由哪些原因造成?

11. public void addStrings(List list) { 
12. list.add(”foo”); 
13. list.add(”bar”); 
14. } 
What must you change in this method to compile without warnings?() 

参考答案:

  参考解析

本题暂无解析

在线 客服