Skip to content

Commit 4ac1071

Browse files
authored
Multilevel Inheritance
1 parent a592ad4 commit 4ac1071

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Inheritance/Multilevel.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//Created by Shashwat Raj
2+
#include<iostream>
3+
using namespace std;
4+
5+
class Book
6+
{
7+
public:
8+
Book()
9+
{
10+
cout<<"Base Class Constructor of Book"<<endl;
11+
}
12+
};
13+
class Comic
14+
{
15+
public:
16+
Comic()
17+
{
18+
cout<<"Base class Constructor of Comic"<<endl;
19+
}
20+
};
21+
class eBook:public Book, public Comic
22+
{
23+
public:
24+
eBook()
25+
{
26+
cout<<"Derived Class Constructor of eBook"<<endl;
27+
}
28+
};
29+
30+
int main()
31+
{
32+
eBook eB;
33+
}

0 commit comments

Comments
 (0)