1.

How do we define a constructor when class name is x

Answer»

Constructors INITIALIZE values to object members after storage is allocated to the object. class A { into X; public: A(); //CONSTRUCTOR }; While DEFINING a constructor you must remember that the name of constructor will be same as the name of the class, and constructors NEVER have return type.



Discussion

No Comment Found

Related InterviewSolutions