A. java.util.TreeSet B. java.util.Hashtable C. java.util.Vector D. java.util.LinkedList
現(xiàn)有: 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); } } 結(jié)果為:()
A. one B. one three two C. one two three D. one two three four E. four one three two F.編譯失敗
現(xiàn)有: 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行將導(dǎo)致輸出“abc"?()
A. for (Iterator o : list.iterator(); o.hasNext (); ) B. for (Iterator 0 : list) C. for (Object o : list.iterator()) D. for (Object o : list)