WAP to show the working of abstract class by considering suitable example
#include <iostream>
using namespace std;
class publisher
{
public:
string pname;
string place;
void get()
{
cout << "get the value" << endl;
}
void display()
{
cout << "display the value " << endl;
}
};
class author
{
public:
string aname;
void get()
{
cout << "get the value" << endl;
}
void display()
{
cout << "display the value " << endl;
}
};
class book : public publisher, public author
{
public:
string title;
int price;
int pages;
void get()
{
cout << "get the value" << endl;
}
void display()
{
cout << "display the value " << endl;
}
};
int main()
{
book obj;
return 0;
}
Comments
Leave a comment