2080 2

Object Oriented Programming208010 marksInitialization of class objects

What is constructor? Why constructor is needed in a class? Illustrate the types of constructor with an example.

What is constructor? Why constructor is needed in a class? Illustrate the types of constructor with an example.[10]

A constructor is a special member function of a class that is automatically called when an object of that class is created. It has the same name as the class and is used to initialize the data members of the class. - It has the same name as the class - It has no return type (not even void) - It i...

Up nextWhen inline functions may not work? Define and write syntax for default arguments. Write a