Characteristics
of Constructors
•
The name of the constructor must be same as that of the class
•
No return type can be specified for constructor
•
A constructor can have parameter list
•
The constructor function can be overloaded
•
They cannot be inherited but a derived class can call the base class
constructor
•
The compiler generates a constructor, in the absence of a user defined
constructor.
•
Compiler generated constructor is public member function
•
The constructor is executed automatically when the object is created
•
A constructor can be used explicitly to create new object of its class type
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.