Question: Consider the following Point2D class. public class Point2D { private double xCoord; private double yCoord; public Point2D(double x, double y) { xCoord = x; }

Consider the following Point2D class. public class Point2D

 { private double xCoord; private double yCoord; 
 public Point2D(double x, double y) 
 { xCoord = x; } yCoord = y; 

} Which of the following code segments, appearing in a class other than Point2D, will correctly create an instance of a Point2D object?

A Point2D p = (3.0, 4.0);

B Point2D p = Point2D(3.0, 4.0);

C new p = Point2D(3.0, 4.0);

D new Point2D = p(3.0, 4.0);

E Point2D p = new Point2D(3.0, 4.0);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!