1.importjava.util.*;2.publicclassTestSet{3.enumExample{ONE,TWO,THREE}4.publicstaticvoidmain(String[]args){5.Collectioncoll=newArrayList();6.coll.add(Example.THREE);7.coll.add(Example.THREE);8.coll.add(Example.THREE);9.coll.add(Example.TWO);10.coll.add(Example.TWO);11.coll.add(Example.ONE);12.Setset=newHashSet(coll);13.}14.}Whichstatementistrueaboutthesetvariableonline12?()
A.Thesetvariablecontainsallsixelementsfromthecollcollection,andtheorderisguaranteedtobepreserved.
B.Thesetvariablecontainsonlythreeelementsfromthecollcollection,andtheorderisguaranteedtobepreserved.
C.Thesetvariablecontainsallsixelementsfromthecoilcollection,buttheorderisNOTguaranteedtobepreserved.
D.Thesetvariablecontainsonlythreeelementsfromthecoilcollection,buttheorderisNOTguaranteedtobepreserved.
第1题:
以下对枚举类型名的定义中正确的是
A.enum a {one=9,two=-1,three};
B.enum a={“one”, “two”, “three”};
C.enum a {“one”, “two”, “three”};
D.enum a={one, two, three};
第2题:
5、以下对枚举类型名的定义中正确的是()。
A.enum a={one,two,three};
B.enum a{one=9,two,three};
C.enum a={"one","two","three"};
D.enum a{"one","two","three"};
第3题:
以下对枚举类型名的定义中正确的是()。
A.enum a={one,two,three};
B.enum a {one=9,two=-1,three};
C.enum a={"one","two","three"};
D.enum a {"one","two","three"};
第4题:
8、以下对枚举类型名的定义中正确的是
A.enum a {one=9,two=-1,three};
B.enum a={“one”, “two”, “three”};
C.enum a {“one”, “two”, “three”};
D.enum a={one, two, three};
第5题:
7、以下对枚举类型名的定义中正确的是()。
A.enum a={one,two,three};
B.enum a {one=9,two=-1,three};
C.enum a={"one","two","three"};
D.enum a {"one","two","three"};