자격증/OCJP_ExamB

QUESTION 34

IT grow. 2018. 7. 10. 22:42
반응형

QUESTION 34 


Given classes defined in two different files: 

 

1. package util; 

2. public class BitUtils { 

3.     public static void process(byte[] b) { /* more code here */ } 

4. } 

 

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. util.BitUtils.process(bytes); 

D. SomeApp cannot use methods in BitUtils. 

E. import util.BitUtils.*; process(bytes); 


Solution : C 



plus imformation 


패키지명.클래스명.메소드명(값)


반응형