nerdexam
Oracle

1Z0-851 · Question #191

Given: package test; class Target { public String name = "hello"; } What can directly access and change the value of the variable name?

The correct answer is C. any class in the test package. See the full explanation below for the reasoning.

Question

Given: package test; class Target { public String name = "hello"; } What can directly access and change the value of the variable name?

Exhibit

1Z0-851 question #191 exhibit

Options

  • Aany class
  • Bonly the Target class
  • Cany class in the test package
  • Dany class that extends Target

How the community answered

(27 responses)
  • A
    11% (3)
  • B
    4% (1)
  • C
    81% (22)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice