Hybrid Inheritance in C++ | Learn Coding
Vložit
- čas přidán 27. 08. 2024
- Hybrid inheritance is a combination of multiple inheritance and multilevel inheritance. A class is derived from two classes as in multiple inheritance. However, one of the parent classes is not a base class. It is a derived class.
In Hybrid inheritance using virtual keyword to solve “Diamond Problem”. It ensures that the child class gets only a single instance of the common base class. In other words, the Snake class will have only one instance of the LivingThing class. The Animal and Reptile classes share this instance.
What is inheritance click this link 👍👍
• Video
More video please visit here-#learningcwithprogramming 👍👍👍
What is inheritance?
czcams.com/video/zDLzfljx7Lo/video.html
1:29
thank you so much @learn coding..
Thanku
It's been 2 days I was stick to this problem
You are the best.
You are the best ❤️ teacher 💖
Can we use downward arrows too to represent flow chart sir?????
good topic good explain❤
Thank you sir 🙏🙏
It is also known as virtual derivation?
Thanks, aaysi main kise se nahi khata but ☺️
Super lecture ❤
sir multilevel aur herachical me kya differnce he dono me many derived class reheta he
multilevel mein ek derive class dusri derive class ko bhi inherit kr skti hai but herarchial mein derive classes ek dusre ko inherit nhi kr skti bas itna difference hai jo muzhe samazh aaya...
2:27 minit pe......flow chart me class A-> class B , Class c ....is hierarchical inheritance hota he ?
He said opposite claas A is base and B and C are derived so it is hierarchical inheritance and B and C are base for D derived class so it is multiple inheritance
Saste nashe kiya h vo😂
yess you are correct..
ABC are multilevel inheritance hoga na ??
😊
👍🙏🤟✌
Thank sir
Sir, What if we write "class D: public B" only not public b, public c. Now will compiler get confused to inherit through B or C as you explained in the video......?
No it will not.
Compiler will easily execute then
A machanism of dividing a one class from old class is called inheritance
Virtual Function per vidio banao sir ji
❤❤❤❤❤❤
#
In class D : public A is correct or wrong..
Galat hoga kyuki phir yeh multiple inheritance ho jayega kyuki D directly A se inherit kr raha h toh code phir run easily hoga
Class d already b aur c ko access kar raha hai jo ki a ko access kar rahe hai matlab class d indirectly a ko bhi access kar paa raha hai
show all code togher at last
Program thode level ke bnna dete sir ji
isn't this multipath inheritance?
It is a combination of hierarchical and multiple inheritance.