120k views
4 votes
What is the difference between the default constructor and the overloaded constructor?

User Orcaman
by
8.2k points

1 Answer

1 vote

Step-by-step explanation:

A default constructor is a constructor that present in the class by default with no parameters when we write a new constructor with parameters it is called overloaded constructor.There can be different overloaded constructors in the same class.

The main difference between default constructor and overloaded constructor is that the default constructor does't have any parameters while the overloaded constructors have parameters.

User Jens Becker
by
8.3k points