Oracle
1Z0-851 · Question #153
Given: 09. class Line { 10. public static class Point {} 11. } 12. 13. class Triangle { 14. public Triangle(){ 15. // insert code here 16. } 17. } Which code, inserted at line 15, creates an…
The correct answer is B. Line.Point p = new Line.Point(). See the full explanation below for the reasoning.
Question
Given: 09. class Line { 10. public static class Point {} 11. } 12. 13. class Triangle { 14. public Triangle(){ 15. // insert code here 16. } 17. } Which code, inserted at line 15, creates an instance of the Point class defined in Line?
Options
- APoint p = new Point();
- BLine.Point p = new Line.Point();
- CThe Point class cannot be instatiated at line 15.
- DLine l = new Line() ; l.Point p = new l.Point();
How the community answered
(46 responses)- A15% (7)
- B72% (33)
- C4% (2)
- D9% (4)
Community Discussion
No community discussion yet for this question.