Hybrid Inheritance in C++ | Learn Coding

Sdílet
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 👍👍👍

Komentáře • 35

  • @LearnCodingOfficial
    @LearnCodingOfficial  Před 4 lety +3

    What is inheritance?
    czcams.com/video/zDLzfljx7Lo/video.html

  • @kevinyoutube4243
    @kevinyoutube4243 Před 2 lety +2

    thank you so much @learn coding..

  • @radhagoyal3606
    @radhagoyal3606 Před 2 lety +3

    Thanku
    It's been 2 days I was stick to this problem

  • @toxicnepal4003
    @toxicnepal4003 Před rokem +1

    You are the best.

  • @SamadKhan-bv8gs
    @SamadKhan-bv8gs Před 4 měsíci

    You are the best ❤️ teacher 💖

  • @HarForever
    @HarForever Před 4 měsíci +1

    Can we use downward arrows too to represent flow chart sir?????

  • @YogeshChhalotre
    @YogeshChhalotre Před 3 měsíci

    good topic good explain❤

  • @harshmarkam6883
    @harshmarkam6883 Před 8 měsíci +1

    Thank you sir 🙏🙏

  • @jiya1402
    @jiya1402 Před 2 lety +3

    It is also known as virtual derivation?

  • @rushikeshchoudekar233
    @rushikeshchoudekar233 Před rokem +1

    Thanks, aaysi main kise se nahi khata but ☺️

  • @animaqaar
    @animaqaar Před 3 měsíci

    Super lecture ❤

  • @massiahplays2261
    @massiahplays2261 Před 3 lety +3

    sir multilevel aur herachical me kya differnce he dono me many derived class reheta he

    • @vasubansal2618
      @vasubansal2618 Před 3 lety

      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...

  • @nidhipatel5725
    @nidhipatel5725 Před 2 lety +5

    2:27 minit pe......flow chart me class A-> class B , Class c ....is hierarchical inheritance hota he ?

    • @yogeshkanare6312
      @yogeshkanare6312 Před 2 lety +2

      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

    • @saurabhpandey7828
      @saurabhpandey7828 Před rokem +1

      Saste nashe kiya h vo😂

    • @funnyadda374
      @funnyadda374 Před 2 měsíci

      yess you are correct..

  • @extraordinaryfigo6863
    @extraordinaryfigo6863 Před 2 měsíci

    ABC are multilevel inheritance hoga na ??

  • @pnpranav8145
    @pnpranav8145 Před 8 měsíci +1

    😊

  • @manojchhapriya8170
    @manojchhapriya8170 Před rokem +1

    👍🙏🤟✌

  • @vermas943
    @vermas943 Před 4 měsíci

    Thank sir

  • @vasubansal2618
    @vasubansal2618 Před 3 lety +1

    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......?

    • @radhagoyal3606
      @radhagoyal3606 Před 2 lety

      No it will not.
      Compiler will easily execute then

  • @user-do2ui3ux1h
    @user-do2ui3ux1h Před 5 měsíci

    A machanism of dividing a one class from old class is called inheritance

  • @faisals6865
    @faisals6865 Před 4 měsíci

    Virtual Function per vidio banao sir ji

  • @memesmaster164
    @memesmaster164 Před 5 měsíci

    ❤❤❤❤❤❤

  • @kevinyoutube4243
    @kevinyoutube4243 Před 2 lety +2

    #

  • @_AkankM
    @_AkankM Před 2 lety +1

    In class D : public A is correct or wrong..

    • @saurabhpandey7828
      @saurabhpandey7828 Před rokem

      Galat hoga kyuki phir yeh multiple inheritance ho jayega kyuki D directly A se inherit kr raha h toh code phir run easily hoga

    • @Unknown-zz6ku
      @Unknown-zz6ku Před rokem +2

      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

  • @sawfall9662
    @sawfall9662 Před 2 lety +1

    show all code togher at last

  • @mohitmk8693
    @mohitmk8693 Před 3 lety +1

    Program thode level ke bnna dete sir ji

  • @namdul9296
    @namdul9296 Před 2 lety +1

    isn't this multipath inheritance?

    • @M374L
      @M374L Před rokem

      It is a combination of hierarchical and multiple inheritance.