web analytics

Write some properties of constructor?

Properties of Constructor Function: Following are some properties of Constructor Function

  1. They will have the same name as of their class.
  2. They should be declared in the public section.
  3. They are executed automatically when objects are created.
  4. They do not have return types, not even void and thus they can’t return values.
  5. They can’t be inherited, though a derived class can call the base class constructor.
  6. They can have default arguments.
  7. Constructors can not be virtual.
  8. Their addresses can not be referred.
  9. An object with a constructor can not be used as a member of a union.
  10. They make ‘implicit calls’ to the operators new and delete when memory allocation is required.

Please follow and like us:
Pin Share
RSS
Follow by Email
Scroll to Top