हिंदी

Need of using a Constructor

Advertisements

Topics

CISCE: Class 10

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. 

Related QuestionsVIEW ALL [1]

Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×