Why would you overload a constructor method in a class? code example
Example 1: Can we overload the constructors
Yes, the constructors can be overloaded by changing the number of
arguments accepted by the constructor or by changing the data type of
the parameters
Example 2: overloading constructors
Yes, the constructors can be overloaded by
changing the number of
arguments accepted by the constructor
or by changing the data type of
the parameters