nerdexam
Oracle

1Z0-851 · Question #252

Given: class Nav{ public enum Direction { NORTH, SOUTH, EAST, WEST } } public class Sprite{ // insert code here } Which code, inserted at line 14, allows the Sprite class to compile?

The correct answer is D. Nav.Direction d = Nav.Direction.NORTH. See the full explanation below for the reasoning.

Question

Given: class Nav{ public enum Direction { NORTH, SOUTH, EAST, WEST } } public class Sprite{ // insert code here } Which code, inserted at line 14, allows the Sprite class to compile?

Options

  • ADirection d = NORTH;
  • BNav.Direction d = NORTH;
  • CDirection d = Direction.NORTH;
  • DNav.Direction d = Nav.Direction.NORTH;

How the community answered

(42 responses)
  • A
    5% (2)
  • B
    12% (5)
  • C
    2% (1)
  • D
    81% (34)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice