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.

Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends


Contact Us