Oracle
1Z0-851 · Question #132
Given classes defined in two different files: package util; public class BitUtils { public static void process(byte[] b) { / more code here / } } 1. package app; 2. 3. public class SomeApp { 4…
The correct answer is C. util.BitUtils.process(bytes). See the full explanation below for the reasoning.
Question
Given classes defined in two different files: package util; public class BitUtils { public static void process(byte[] b) { /* more code here */ } } 1. package app; 2. 3. public class SomeApp { 4. public static void main(String[] args) { 5. byte[] bytes = new byte[256]; 6. // insert code here 7. } 8. } What is required at line 5 in class SomeApp to use the process method of BitUtils?
Options
- Aprocess(bytes);
- BBitUtils.process(bytes);
- Cutil.BitUtils.process(bytes);
- DSomeApp cannot use methods in BitUtils.
- Eimport util.BitUtils.*; process(bytes);
How the community answered
(50 responses)- A14% (7)
- B2% (1)
- C76% (38)
- D2% (1)
- E6% (3)
Community Discussion
No community discussion yet for this question.