QUESTION 43자격증/OCJP_ExamB2018. 7. 13. 18:09
Table of Contents
반응형
QUESTION 43
Given:
static void test() throws Error { if (true) throw new AssertionError(); System.out.print("test "); } public static void main(String[] args) { try { test(); } catch (Exception ex) { System.out.print("exception "); } System.out.print("end "); } }
What is the result?
A. end
B. Compilation fails.
C. exception end
D. exception test end
E. A Throwable is thrown by main.
F. An Exception is thrown by main.
Solution : E
plus imformation
Exception in thread "main" java.lang.AssertionError
at A.test(Main.java:2)
at A.main(Main.java:6)
반응형
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 45 (0) | 2018.07.13 |
---|---|
QUESTION 44 (0) | 2018.07.13 |
QUESTION 42 (0) | 2018.07.13 |
QUESTION 41 (0) | 2018.07.11 |
QUESTION 40 (0) | 2018.07.11 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상