QUESTION 11
Given:
import java.util.*;
public class Explorer1
{
public static void main(String[] args)
{
TreeSet<Integer> s = new TreeSet<Integer>();
TreeSet<Integer> subs = new TreeSet<Integer>();
for(int i = 606; i < 613; i++)
if(i%2 == 0) s.add(i);
subs = (TreeSet)s.subSet(608, true, 611, true);
s.add(609);
System.out.println(s + " " + subs);
}
}
What is the result?
A. Compilation fails.
B. An exception is thrown at runtime.
C. [608, 609, 610, 612] [608, 610]
D. [608, 609, 610, 612] [608, 609, 610]
E. [606, 608, 609, 610, 612] [608, 610]
F. [606, 608, 609, 610, 612] [608, 609, 610]
Solution : F
plus imformation :
Subset : from ~ to ( 범위 내에서 ) 값 반환
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 13 (0) | 2018.07.09 |
---|---|
QUESTION 12 (0) | 2018.07.09 |
QUESTION 10 (0) | 2018.07.09 |
QUESTION 9 (0) | 2018.07.09 |
QUESTION 8 (0) | 2018.07.09 |
#IT #먹방 #전자기기 #일상
#개발 #일상