QUESTION 32자격증/OCJP_ExamC2018. 7. 24. 20:03
Table of Contents
반응형
QUESTION 32Given:1. public static void main(String[] args) {2. try {3. args = null;4. args[0] = "test";5. System.out.println(args[0]);6. } catch (Exception ex) {7. System.out.println("Exception");8. } catch (NullPointerException npe) {9. System.out.println("NullPointerException");10. }11. }What is the result?A. testB. ExceptionC. Compilation fails.D. NullPointerExceptionSolution : C
plus imformation
Main.java:8: exception java.lang.NullPointerException
has already been caught
} catch (NullPointerException npe) {
^ 1 error
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 34 (0) | 2018.07.24 |
---|---|
QUESTION 33 (0) | 2018.07.24 |
QUESTION 31 (0) | 2018.07.24 |
QUESTION 30 (0) | 2018.07.24 |
QUESTION 29 (0) | 2018.07.24 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상