Oracle
1Z0-815 · Question #60
Given: It is required that if p instanceof Pair then p.isValid() returns true. Which is the smallest set of visibility changes to insure this requirement is met?
The correct answer is B. left and right must be private. See the full explanation below for the reasoning.
Question
Given:
It is required that if p instanceof Pair then p.isValid() returns true. Which is the smallest set of visibility changes to insure this requirement is met?
Exhibit
Options
- AsetLeft and setRight must be protected.
- Bleft and right must be private.
- CisValid must be public.
- Dleft, right, setLeft, and setRight must be private.
How the community answered
(35 responses)- A6% (2)
- B77% (27)
- C14% (5)
- D3% (1)
Community Discussion
No community discussion yet for this question.
