Which code, inserted at line 15, creates an instance of the Point class defined in Line?

Given:
10. class Line {

11. public static class Point {}
12. }
13.
14. class Triangle {
15. // insert code here
16. }
Which code, inserted at line 15, creates an instance of the Point class defined in Line?

Given:
10. class Line {

11. public static class Point {}
12. }
13.
14. class Triangle {
15. // insert code here
16. }
Which code, inserted at line 15, creates an instance of the Point class defined in Line?

A.
Line.Point p = new Line.Point();

B.
The Point class cannot be instatiated at line 15.

C.
Point p = new Point();

D.
Line l = new Line() ; l.Point p = new l.Point();



Leave a Reply 0

Your email address will not be published. Required fields are marked *