QUESTION 46자격증/OCJP_ExamB2018. 7. 13. 19:17
Table of Contents
반응형
QUESTION 46Given:public class Foo{static int[] a;static { a[0]=2;}public static void main( String[] args ){}}Which exception or error will be thrown when a programmer attempts to run this code?A. java.lang.StackOverflowErrorB. java.lang.IllegalStateExceptionC. java.lang.ExceptionInInitializerErrorD. java.lang.ArrayIndexOutOfBoundsExceptionSolution : C
plus imformation
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
at Foo.<clinit>(Main.java:3)
Could not find the main class: Foo. Program will exit.
반응형
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 48 (0) | 2018.07.13 |
---|---|
QUESTION 47 (0) | 2018.07.13 |
QUESTION 45 (0) | 2018.07.13 |
QUESTION 44 (0) | 2018.07.13 |
QUESTION 43 (0) | 2018.07.13 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상