nerdexam
Oracle

1Z0-851 · Question #25

Given classes defined in two different files: package util; public class BitUtils { private static void process(byte[] b) {} } 01. package app; 02. public class SomeApp { 03. public static void…

The correct answer is F. SomeApp cannot use the process method in BitUtils. See the full explanation below for the reasoning.

Question

Given classes defined in two different files: package util; public class BitUtils { private static void process(byte[] b) {} } 01. package app; 02. public class SomeApp { 03. public static void main(String[] args) { 04. byte[] bytes = new byte[256]; 05. // insert code here 06. } 07. } What is required at line 5 in class SomeApp to use the process method of BitUtils?

Options

  • Aprocess(bytes);
  • BBitUtils.process(bytes);
  • Capp.BitUtils.process(bytes);
  • Dutil.BitUtils.process(bytes);
  • Eimport util.BitUtils.*; process(bytes);
  • FSomeApp cannot use the process method in BitUtils.

How the community answered

(41 responses)
  • A
    2% (1)
  • B
    5% (2)
  • C
    10% (4)
  • D
    2% (1)
  • F
    80% (33)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice