There are three various types of constructors , and they are as follows:.
- Default Constructor – With no parameters.
- Parametric Constructor – With Parameters. Create a new instance of a class and also passing arguments simultaneously.
- Copy Constructor – Which creates a new object as a copy of an existing object.
- Default Constructor – With no parameters.
- Parametric Constructor – With Parameters. Create a new instance of a class and also passing arguments simultaneously.
- Copy Constructor – Which creates a new object as a copy of an existing object.
No comments:
Post a Comment