QUESTION 35자격증/OCJP_ExamA2018. 7. 6. 16:44
Table of Contents
반응형
QUESTION 35
Given:
public class Donkey2
{
public static void main(String[] args) {
boolean assertsOn = true;
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 : C
반응형
'자격증 > OCJP_ExamA' 카테고리의 다른 글
QUESTION 37 (0) | 2018.07.08 |
---|---|
QUESTION 36 (0) | 2018.07.08 |
QUESTION 34 (0) | 2018.07.06 |
QUESTION 33 (0) | 2018.07.06 |
QUESTION 32 (0) | 2018.07.01 |
@IT grow. :: IT grow.
#IT #먹방 #전자기기 #일상
#개발 #일상