What are constructors use for?

Constructor is used to initializing objects of a class and allocate appropriate memory to objects . That is, it is used to initialize the instance variables of a class with a different set of values but it is not necessary to initialize.

Sizin İçin Seçtik  How do you calculate student percentage in C++?

Leave a Reply

Your email address will not be published. Required fields are marked *