QUESTION 42자격증/OCJP_ExamB2018. 7. 13. 17:53
Table of Contents
반응형
QUESTION 42
Given:
public class Donkey {
public static void main(String[] args) {
boolean assertsOn = false;
assert (assertsOn) : assertsOn = true;
if(assertsOn) {
System.out.println("assert is on");
}
}
}
If class Donkey is invoked twice, the first time without assertions enabled, and the second time with assertions enabled, what are the results?
A. no output
B. no output assert is on
C. assert is on
D. no output An AssertionError is thrown.
E. assert is on An AssertionError is thrown.
Solution : D
반응형
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 44 (0) | 2018.07.13 |
---|---|
QUESTION 43 (0) | 2018.07.13 |
QUESTION 41 (0) | 2018.07.11 |
QUESTION 40 (0) | 2018.07.11 |
QUESTION 39 (0) | 2018.07.11 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상