nerdexam
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)
  • A
    15% (7)
  • B
    72% (33)
  • C
    4% (2)
  • D
    9% (4)

Community Discussion

No community discussion yet for this question.

Full 1Z0-851 Practice