C++ Multilevel Inheritance In Hindi – Inheritance OOPs In Hindi

C++
Loading...

C++ Multilevel Inheritance In HindiInheritance OOPs In Hindi – 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 |

Read Also :- C++ Single Inheritance In Hindi

C++ Multilevel 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 OOPs 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

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.

Inheritance Ko 2 Class Dena Jaruri Hota Hain |

  • Base Class 1 (Parent 1): Base class Ko parent class Bhi Kaha Jata Hain.
  • Derived Class 2 (Base Class 1): Derived class Ko Sub Ya child class Bhi Kaha Jata Hain| Derived class Ye Base class Ki properties Ya attributes Ko inherit Karta Hai |
  • MultiLevel Derived Class(Derived Class 2): Derived class Ko sub Ya child class Bhi Kaha Jata Hain| Derived class Ye Derived Class 2 Or Base class Ki properties Ya attributes Ko inherit Karta Hai |
Multilevel Inheritance in Python

Example:

// Base class (parent)
class MyClass {
  public:
    void myFunction() {
      cout << "This is MyClass Content." ;
    }
};

// Derived class (child)
class MyChild: public MyClass {
};

// Derived class (grandchild)
class MyGrandChild: public MyChild {
};

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

Aap Program Ko Dekh Sakte Hai, Ki Hamne Ek Upper Base Class MyClass Create Kiya Hai Or Uske Under Ek Method myFunction Create Kiya Hai, Uske Bad Hamne Derived Class MyChild: Create Ki Hai Or Uske Hi Sath MyClass Ko Inherit Bhi Kiya Hai Or Waise Hi Ek Or Class MyGrandChild Create Ki Hai Or Uske Hi Sath MyChild Class Ko Inherit Bhi Kiya Hai And Ise Ham Hi Multilevel Inheritance Kahte Hai |

Output:

This is MyClass Content.

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

Types Of Inheritance in C++ in Hindi

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

Friends Mujhe Umeed Hai Ki Aapko C Plus Plus Multilevel 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.