Constructor


  • Constructor is used to initialize objects of its class.
  • A constructor initializes an object immediately after its creation. It has same name as the class name in it resides. 
  • Constructor is a special kind of method that determines how an object is initialized when created.

  • Constructor does not have a return type, not even void.

  • Constructor is of three types:

  1. Default Constructor
  2. Parameterized constructor
  3. Copy Constructor.
Previous
Next Post »