Question: Identify the valid and invalid overloaded constructors in the following code: public class PointD { private double x; private double y; * // constructor 1
Identify the valid and invalid overloaded constructors in the following code:

public class PointD { private double x; private double y; * // constructor 1 public PointD() { } } // constructor 2 public PointD (double x) { } // constructor 3 public PointD (double y) { } // constructor 4 public PointD (double x, double y) { // constructor 5 public PointD (double y, double x) { // constructor 6 public PointD (PointD pt) { }
Step by Step Solution
3.50 Rating (147 Votes )
There are 3 Steps involved in it
In Java overloaded constructors are used to create objects in different ways by initializing them wi... View full answer
Get step-by-step solutions from verified subject matter experts
