Inheritance in hindi

हेलो स्टूडेंट्स, इस पोस्ट में हम आज Inheritance in hindiके बारे में पढ़ेंगे | इंटरनेट में C++ भाषा के नोट्स हिंदी में बहुत कम उपलब्ध है, लेकिन हम आपके लिए यह हिंदी में डिटेल्स नोट्स लाये है, जिससे आपको यह टॉपिक बहुत अच्छे से समझ आ जायेगा |

हेल्लो दोस्तों! आज मैं आपको बहुत ही आसान भाषा में Inheritance in Hindi (इनहेरिटेंस क्या है और इसके प्रकार) के बारें में बताऊंगा और इसके syntax को भी देखेंगे तो चलिए शुरू करते हैं:-

अनुक्रम (contents)

Inheritance in Hindi

inheritance एक ऐसा mechanism है जिससे एक old class से new class create किया जाता है। इस के द्वारा old class की properties को new class में प्रयोग किया जा सकता है। old class की properties को new class में प्रयोग करने के लिए old class को inherit करना होता है। और class को inherit करने के लिए derivation public , private और protected का प्रयोग किया जाता है।

इनहेरिटेंस में old class को base class या parent class या super class कहा जाता है , जिस class की property ली जाती है। और new class को child class या derived class या sub class कहा जाता है , जिस class के द्वारा property ली जाती है।

Types of inheritance in Hindi

यहाँ पांच प्रकार के इनहेरिटेंस है –

  1. Single
  2. Multiple
  3. Multilevel
  4. Hierarchical
  5. Hybrid
  6. Single inheritance in Hindi

जब किसी एक class को किसी दुसरे class द्वारा inherit किया जाता है तो उस इनहेरिटेंस को single inheritance कहते है। इसमें एक class की property को दुसरे class द्वारा लिया जाता है। इस में केवल एक super class और एक sub class होता है।

Single inheritance
Single inheritance

Syntax :- class A

{

};

Class B : public A

{

};

  1. Multiple inheritance in Hindi

जब एक से अधिक classes को एक class द्वारा inherit किया जाता है उस इनहेरिटेंस को multiple inheritance कहते है। इसमें एक से अधिक class की property को एक class द्वारा inherit किया जाता है। इस में एक से अधिक super class और एक sub class होते है.
जावा मल्टीप्ल इनहेरिटेंस को support नहीं करती है.

Multiple inheritance in hindi
Multiple inheritance in hindi

Syntax :- Class A

{

};

Class B

{

};

Class C : public A , public B

{

};

  1. Multilevel inheritance in Hindi

जब एक से अधिक class एक level में एक दूसरे को inherit करते है तो उस इनहेरिटेंस को multilevel inheritance कहते है। इसमें एक class किसी दुसरे class को inherit करता है और वह class जो class को inherit करता है वह sub class बन जाता है और उसी sub class को दुसरे class द्वारा inherit किया जाता है। इसी प्रकार सभी class एक दुसरे को inherit करते है।

Multilevel inheritance in hindi
Multilevel inheritance in hindi

Syntax:- Class A

{

};

Class B : public A

{

};

Class C : public B

{

};

  1. Hierarchical inheritance in Hindi

जब एक base class को एक से अधिक sub class द्वारा inherit किया जाता है तो उस इनहेरिटेंस को hierarchical inheritance कहते है। इसमें एक class की property को एक से अधिक class द्वारा लिया जाता है। hierarchical इनहेरिटेंस में एक base class और एक से अधिक sub class होते है। यह multiple इनहेरिटेंस के विपरीत होता है।

Hierarchical inheritance in hindi
Hierarchical inheritance in hindi

Syntax:- Class A

{

};

Class B : public A

{

};

Class C : public A

{

};

Class D : public A

{

};

  1. Hybrid inheritance in Hindi

जब हम किसी दो प्रकार के इनहेरिटेंस को अपने program में mix करते है तो उसे hybrid इनहेरिटेंस कहते है। यह इनहेरिटेंस एक से अधिक इनहेरिटेंस का combination होता है। अर्थात् यह दो या दो से अधिक इनहेरिटेंस से मिलकर बना होता है.

Hybrid inheritance in hindi
image

Also read : c++ language mcq in hindi interview questions बहुविकल्पीय प्रश्न

Syntax :- Class A

{

};

Class B : public A

{

};

Class C

{

};

Class D : public B , public C

{

};

इसे भी पढ़ें:- OOPS के concepts क्या क्या है?
OSI model क्या है?
C और c++ में क्या अंतर है?

निवेदन:- अगर आपके लिए यह उपयोगी रहा हो तो नीचे कमेंट करके बताइए और इसे अपने classmates के साथ अवश्य share करें.

अपने दोस्तों के साथ share कीजिये.

Related

हम आशा करते है कि यह Inheritance in hindi के हिंदी में नोट्स आपकी स्टडी में उपयोगी साबित हुए होंगे | अगर आप लोगो को इससे रिलेटेड कोई भी किसी भी प्रकार का डॉउट हो तो कमेंट बॉक्स में कमेंट करके पूंछ सकते है | आप इन्हे अपने Classmates & Friends के साथ शेयर करे |

Leave a Comment

Your email address will not be published. Required fields are marked *