Question
1.
#include
2.
using namespace std;
3.
class MyInterface
4.
{
5.
public:
6.
virtual void Display() = 0;
7.
};
8.
class Class1 : public MyInterface
9.
{
10.
public:
11.
void Display()
12.
{
13.
int a = 5;
14.
cout
What is the output of this program?
1.
#include
2.
using namespace std;
3.
class MyInterface
4.
{
5.
public:
6.
virtual void Display() = 0;
7.
};
8.
class Class1 : public MyInterface
9.
{
10.
public:
11.
void Display()
12.
{
13.
int a = 5;
14.
cout
Answer: Option C
Was this answer helpful ?
In this program, We are displaying the data from the two classes
by using abstract class.
Output:
$ g++ abs1.cpp
$ a.out
5 5
Was this answer helpful ?
More Questions on This Topic :
Question 3.
Which is also called as abstract class?
....
Submit Solution