MENU
Question -

What is constructor overloading ? Give an example to illustrate the same.



Answer -

Declaring constructors with different parameters in a program is called Constructor overloading. [1]
Example:

class Circle
{
int radius, area; public:
Circle()    //Constructor
{
radius=0;
}
Circle(int r)//Constructor Overloaded
{
radius=r;
}
};    [1]

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×