What is the constructor in a class?

A class constructor is a special member function of a class that is executed whenever we create new objects of that class . A constructor will have exact same name as the class and it does not have any return type at all, not even void.

Sizin İçin Seçtik  How many types of constructors are there?

Leave a Reply

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