Constructor

From JholJhapata
Revision as of 06:57, 5 January 2020 by Admin (talk | contribs) (Created page with "A '''constructor''' is a special method of the class which gets automatically invoked whenever an instance of the class is created. Like methods, a constructor also contains t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A constructor is a special method of the class which gets automatically invoked whenever an instance of the class is created. Like methods, a constructor also contains the collection of instructions that are executed at the time of Object creation. It is used to assign initial values to the data members of the same class.