QUESTION 39
Given classes defined in two different files:
1. package util;
2. public class BitUtils {
3. private static void process(byte[] b) {}
4. }
and
1. package app;
2. public class SomeApp {
3. public static void main(String[] args) {
4. byte[] bytes = new byte[256];
5. // insert code here
6. }
7. }
What is required at line 5 in class SomeApp to use the process method of BitUtils?
A. process(bytes);
B. BitUtils.process(bytes);
C. app.BitUtils.process(bytes);
D. util.BitUtils.process(bytes);
E. import util.BitUtils.*; process(bytes);
F. SomeApp cannot use the process method in BitUtils.
Solution : F
plus imformation
1. package util;
2. public class BitUtils {
3. private static void process(byte[] b) {} // private으로 설정되어 있기 때문에 가져다가 못쓴다.
4. }
'자격증 > OCJP_ExamB' 카테고리의 다른 글
QUESTION 41 (0) | 2018.07.11 |
---|---|
QUESTION 40 (0) | 2018.07.11 |
QUESTION 38 (0) | 2018.07.11 |
QUESTION 36 (0) | 2018.07.10 |
QUESTION 35 (0) | 2018.07.10 |
#IT #먹방 #전자기기 #일상
#개발 #일상