C++ Multiple Inheritance In Hindi – Inheritance In Hindi

C++

C++ Multiple Inheritance In HindiInheritance OOPs In Hindi – C++ Inheritance Allows Karta Hai Hame Ki Class Define Karo Uske Bad Ham Inherits Kar Sakte Hai All Methods And Properties Yani Dusri Class Ke |

For Example:- Derived Class Kar Sakta Hai Parent Class Ke Properties Ko Istemal |

Read Also :- Classes & Object & Data Members Etc

C++ Multiple Inheritance In Hindi

Ek Bar Ek Parent Class Ko Create Karne Ke Bad Ham Parent Class (Base Class ) Ko Ham Derived Class (Sub Class ) Me Istemal kar Sakte Hain And Parent Class Or Derived Class Ke Features To Alag-Alag Honge Hi. Lekin Ham Derived Class Se Parent Class Ke Features Ka Istemal Kar Sakte Hain |

Inheritance OOP Ka Ek Part Hota Hain And Inheritance Mai Ek Se Jyada Classes Hote Hain |

Inheritance In C++ in Hindi Ko Understand Karne Ke Liye Upper Diye Image Ka Example Dekhte Hain

Yadi Aapne  HTML Full Course  And CSS Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

Jaise Aap Dekh Sakte Hai Hamne Ek Parent Class (Vehicle) Create Ki Hain Or Vehicle Mai Koi Type Ke Vahical Hote Unke Liye Hamne Derived Class (Car, Bus, Bike ) Alag- Alag Create Ki Or Ab Inhe Derived Class Se Parent Class Ke Features Ka Istemal Kar Sakte Hain.

Read Also :- C++ Constructors and Destructors

  • Base Class 1 (Parent 1): Base class Ko parent class Bhi Kaha Jata Hain.
  • Base Class 2 (Parent 2): Base class Ko parent class Bhi Kaha Jata Hain. Or Ye Base Class 1 Ka Parent Bhi Hota Hain |
  • Multi Derived Class(Child): Derived class Ko sub Ya child class Bhi Kaha Jata Hain| Derived class Ye Base class Ki properties Ya attributes Ko inherit Karta Hai |

C++ multiple inheritances. Base Classes Ke Jo Features Hote Hain Wo Inherits Karte Hain Multi Derived Class Ko. multiple inheritances Ka Syntax similar Hota Hai Single Inheritance Ke.

C++ Me Class Ko Inherit Karne Ke Liye : Colon Ka Istemal Kiya Jata Hai |

Example:

// Base class
class MyClass {
  public:
    void myFunction() {
      cout << "Some content in parent class." ;
    }
};

// Another base class
class MyOtherClass {
  public:
    void myOtherFunction() {
      cout << "Some content in another class." ;
    }
};

// Derived class
class MyChildClass: public MyClass, public MyOtherClass {
};

int main() {
  MyChildClass myObj;
  myObj.myFunction();
  myObj.myOtherFunction();
  return 0;
}

Aap Program Ko Dekh Sakte Hai, Ki Hamne 2 Base Class MyClass, MyOtherClass Create Ki And Us Base Class Ke Under 2 Method myFunction() , myOtherFunction() Create Kiya Hai, Uske Bad Hamne Ek Derived Class MyChildClass: Create Ki Or Use Base Class MyClass, MyOhterClass Se Inherit Kiya Hai |

Output:

Some content in parent class.
Some content in another class.

Types Of Inheritance in C++ in Hindi

C++ Mai Inheritance 3 Types Ke Hote Hain | Lekin Jo Hamne Abhi Read Kiya Hain Yah Ek Multiple Inheritance Hain |

Abhi Tak Keval Single Inheritance Ko Cover Kiya Hain Lekin Next Post Mai Ham Multiple And Multilevel Inheritance Ko Cover Karne Wale Hain |

Friends Mujhe Umeed Hai Ki Aapko C Plus Plus Multiple Inheritance In Hindi Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |

Leave a Reply

Your email address will not be published.