Skip to content
Total Read 2,157
Properties of Constructor Function: Following are some properties of Constructor Function
- They will have the same name as of their class.
- They should be declared in the public section.
- They are executed automatically when objects are created.
- They do not have return types, not even void and thus they can’t return values.
- They can’t be inherited, though a derived class can call the base class constructor.
- They can have default arguments.
- Constructors can not be virtual.
- Their addresses can not be referred.
- An object with a constructor can not be used as a member of a union.
- They make ‘implicit calls’ to the operators new and delete when memory allocation is required.