Question
1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
Base(){}
7.
~Base(){}
8.
protected:
9.
private:
10.
};
11.
class Derived:public Base
12.
{
13.
public:
14.
Derived(){}
15.
Derived(){}
16.
private:
17.
protected:
18.
};
19.
int main()
20.
{
21.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
Base(){}
7.
~Base(){}
8.
protected:
9.
private:
10.
};
11.
class Derived:public Base
12.
{
13.
public:
14.
Derived(){}
15.
Derived(){}
16.
private:
17.
protected:
18.
};
19.
int main()
20.
{
21.
cout
Answer: Option B
Was this answer helpful ?
We are not allowed to overload the constructors, So it is arising an exception.
Was this answer helpful ?
Submit Solution