Lesson 33 of 34
Inheritance: பரம்பரை
10 min 35 XP
ஒரு class மற்றொரு class-ன் அனைத்தையும் பெற்றுக்கொள்ளலாம் (inherit). பின்னர் புதியவற்றைச் சேர்க்கலாம் அல்லது மாற்றலாம் (override). இதனால் code மீண்டும் எழுத வேண்டியதில்லை.
Example: edit me and press Run
Press Run to see the result here.super() மூலம் பெற்றோர் class-ன் method-ஐ அழைக்கலாம். பொதுவாக __init__-ல் பயன்படுத்துவோம்.
Example: edit me and press Run
Press Run to see the result here.OOP-ன் நான்கு தூண்கள்: Encapsulation, Inheritance, Polymorphism, Abstraction. Interview-களில் இவை பற்றி அடிக்கடி கேட்பார்கள்!