Oracle
1Z0-851 · Question #39
Given: package geometry; public class Hypotenuse { public InnerTriangle it = new InnerTriangle(); class InnerTriangle { public int base; public int height; } } Which statement is true about the…
The correct answer is C. The class must belong to the geometry package. See the full explanation below for the reasoning.
Question
Given: package geometry; public class Hypotenuse { public InnerTriangle it = new InnerTriangle(); class InnerTriangle { public int base; public int height; } } Which statement is true about the class of an object that can reference the variable base?
Options
- AIt can be any class.
- BNo class has access to base.
- CThe class must belong to the geometry package.
- DThe class must be a subclass of the class Hypotenuse.
How the community answered
(31 responses)- A3% (1)
- B10% (3)
- C84% (26)
- D3% (1)
Community Discussion
No community discussion yet for this question.