Java problem "Cannot instantiate the type Point2D"

Solution 1:

That is not how you instantiate a Point2D instance. I believe you want the Point2D.Double(double, double) constructor. Also, you have a typo in your print. It should be something like

Point2D p1 = new Point2D.Double(x1, y1);
System.out.println("p1 is " + p1);