English

Need of using a Constructor

Advertisements

Topics

Need of using a Constructor:

When you create various objects of a class, data members are automatically allocated. But in practice, you may like to have different initial values for instance, for the variable of each object. Thus, a constructor is an instance method used to initialize the object of a class that can automatically be called while creating an object. 

If you would like to contribute notes or other learning material, please submit them using the button below.

Related QuestionsVIEW ALL [1]

Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×