QUESTION 29자격증/OCJP_ExamD2018. 8. 5. 19:29
Table of Contents
반응형
QUESTION 29Click the Exhibit button.1. import java.util.*;2. public class TestSet{3. enum Example {ONE, TWO, THREE }4. public static void main(String[] args) {5. Collection coll = new ArrayList();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. Set set = new HashSet(coll);13. }14. }Which statement is true about the set variable on line 12?A. The set variable contains all six elements from the coll collection, and the order is guaranteed to be preserved.B. The set variable contains only three elements from the coll collection, and the order is guaranteed to be preserved.C. The set variable contains all six elements from the coll collection, but the order is NOT guaranteed to be preserved.D. The set variable contains only three elements from the coll collection, but the order is NOT guaranteed to be preserved.Solution : D
plus imformation
Hashset : 중복을 허용하지 않고 , 순서를 상관하지 않는다.
반응형
'자격증 > OCJP_ExamD' 카테고리의 다른 글
QUESTION 31 (0) | 2018.08.05 |
---|---|
QUESTION 30 (0) | 2018.08.05 |
QUESTION 28 (0) | 2018.08.05 |
QUESTION 27 (0) | 2018.08.05 |
QUESTION 26 (0) | 2018.08.04 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상