black

Java认证考试综合练习

登录

单项选择题

现有: 
import java.util.*;     
class AddStuff2  { 
public static void main(String  []  args)  {     
TreeSett=new TreeSet();     
if (t.add("one"))     
if (t.add("two"))    
if (t.add ("three")) 
add("four"); 
for (String s  :  t)     
System.out.print (s);    
}     
}     
结果为:()     

A. one
B. one three two
C. one two three
D. one two three four
E. four one three two
F.编译失败

相关考题

单项选择题 现有:  3.  import java.util.*;      4.    class ForInTest  {  5.static List list=new ArrayList();     6.  7.public static void main (String  []  args)  {     8.list. add("a"); list. add("b");list. add( "c");    9.    //insert code here     10.    System.out.print (o);    11.    }     12.  }  哪一行插入到第9行将导致输出“abc"?()

单项选择题 现有  public  class  Demo{  public  static void main (String[]  args){     List al=new ArrayList();      a1.add("l");      a1.add("2");      a1.add("2");      a1.add("3");  System.out.println (al);     }     }  上述程序执行后的输出是哪项?()

多项选择题 下列哪些项是泛型的优点?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3