多项选择题
A. Map c= new SortedMap();
B. HashMap c= new HashMap();
C. HashMap c= new Hashtalole();
D. SortedMap c= new TreeMap();
E. ArrayList c= new ArrayList();
F. MaD c = new LinkedHashMap();
单项选择题 现有: 1. import java.util.*; 2. class ForInTest { 3.static List list - new ArrayList(): 4. 5.static List getList() { return list; } 6. 7.public static void main (Strincj[] args) { 8.list.add("a"); list.add("b"); list.add("c"); 9. //insert code here 10. System.out.print (o); 11. } 12. } 第9行插入哪一项将输出abc?()
单项选择题 现有: 1. import java.util.*; 2. class AddStuff { 3.public static void main (String [] args) { 4.TreeSet s= new TreeSet(); 5. s.add( "one"): 6. s.add( "two"): 7. //insert code here 8.for (String s2: sorted) 9.System.out.print (s2+" "); 10. } 11. } 和四个代码片段: s1.sortedSet sorted=s.tailSet(s.first()); s2.sortedSet sorted=s.tailSet(s.first()); s3.sortedSet sorted= (SortedSet)s .tailSet(s.first()); s4.SortedSet sorted= (SortSet)s .tailSet(s.first()); 分别插入到第7行,哪项可以编译?()
单项选择题 现有如下类型: a - java.util.Hashtable b - java.util.List c - java.util.ArrayList d - java.util.SortedSet 和定义: 1-使用本接口,允许用户控制集合中每个元素的插入位置。 2-使用本集合,确保用户可以按照递增或元素的自然顺序遍历集合。 3-本具体类型允许空元素及基于索引的访问。 4-本集合是同步的。 哪一组匹配是对的?()