QUESTION 56자격증/OCJP_ExamC2018. 7. 26. 18:37
Table of Contents
반응형
QUESTION 56Given:static void test() {try {String x = null;System.out.print(x.toString() + " ");}finally { System.out.print("finally ");}}public static void main(String[] args) {try { test();}catch (Exception ex){ System.out.print("exception "); } }What is the result?A. nullB. finallyC. null finallyD. Compilation fails.E. finally exceptionSolution : E
plus imformation
main 문에서 test 호출 --> null .tostring 예외처리 --> test메소드 try문에서 결과값 x --> finally 한번실행 --> main 문에서 catch 문 실행
반응형
'자격증 > OCJP_ExamC' 카테고리의 다른 글
QUESTION 58 (0) | 2018.07.26 |
---|---|
QUESTION 57 (0) | 2018.07.26 |
QUESTION 55 (0) | 2018.07.26 |
QUESTION 54 (0) | 2018.07.26 |
QUESTION 53 (0) | 2018.07.26 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상