QUESTION 19자격증/OCJP_ExamD2018. 8. 3. 18:01
Table of Contents
반응형
QUESTION 19Given a method that must ensure that its parameter is not null:11. public void someMethod(Object value) {12. // check for null value ...20. System.out.println(value.getClass());21. }What, inserted at line 12, is the appropriate way to handle a null value?A. assert value == null;B. assert value != null, "value is null";C. if (value == null) { throw new AssertionException("value is null"); }D. if (value == null) { throw new IllegalArgumentException("value is null"); }Solution : D
반응형
'자격증 > OCJP_ExamD' 카테고리의 다른 글
QUESTION 21 (0) | 2018.08.04 |
---|---|
QUESTION 20 (0) | 2018.08.03 |
QUESTION 18 (0) | 2018.08.03 |
QUESTION 17 (0) | 2018.07.31 |
QUESTION 16 (0) | 2018.07.31 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상