Hybrid Inheritance In cpp
Hybrid Inheritance In cpp
PROGRAM:
#include<iostream> using namespace std; class A{ public: A(){ cout<<"\n grand parent"; } }; class B:public A{ public: B(){ cout<<"\n parent1"; } }; class C:public A{ public: C(){ cout<<"\n parent2"; } }; class D:public B,public C{ public: D(){ cout<<"\n child class"; } }; int main(){ D d; return 0; }
Comments
Post a Comment