Which code, inserted at line 16, correctly retrieves a local instance of a Point object?

Given:
class Line {
public class Point {
public int x, y;
}
public Point getPoint() {
return new Point();
}
}
class Triangle {
public Triangle() {
// insert code here
}
}
Which code, inserted at line 16, correctly retrieves a local instance of a Point object?
A. Point p = Line.getPoint();
B. Line.Point p = Line.getPoint();
C. Point p = (new Line()).getPoint();
D. Line.Point p = (new Line()).getPoint();

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.