Inheritance in Python in hindi with example .

Inheritance in Python 
 
    Object oriented programming मैं बोहोत ही important concept है जैसे inheritance कहते है

 With inheritance one class can derive the properties of another class . 
   तो मन लीजिये आपके कुछ genetic feature आपने अपने parents से inheritance किया होगा । और आपके parents ने उन genetic features को आपके grandparents से inheritance किया होगा ।

   तो आप अपने father की तरह या अपनी mother की तरह देखते होंगे । पर आपके parents आपके grandparent's की तरह दिखते होंगे । 

   तो ये जो है आप genetic features inheritance कर रहे हो । 

  यही concept आप Python programming मैं भी डाल सकते हो तो इसमें आपके पास एक super class रहता है और एक sub class रहता है । 
   तो जो properties super class मैं होती है वो सब super class की properties sub class inheritance कर लेती है । 

Example 

Post a Comment

0 Comments