Lesson 33 of 34
Inheritance: பரம்பரைInheritance: Building on a Class
10 min 35 XP
ஒரு class மற்றொரு class-ன் அனைத்தையும் பெற்றுக்கொள்ளலாம் (inherit). பின்னர் புதியவற்றைச் சேர்க்கலாம் அல்லது மாற்றலாம் (override). இதனால் code மீண்டும் எழுத வேண்டியதில்லை.
A class can inherit everything from another class, then add or change (override) things. No need to rewrite code.
Example: edit me and press Run
Press Run to see the result here.super() மூலம் பெற்றோர் class-ன் method-ஐ அழைக்கலாம். பொதுவாக __init__-ல் பயன்படுத்துவோம்.
super() calls the parent class's method. It's most often used in __init__.
Example: edit me and press Run
Press Run to see the result here.OOP-ன் நான்கு தூண்கள்: Encapsulation, Inheritance, Polymorphism, Abstraction. Interview-களில் இவை பற்றி அடிக்கடி கேட்பார்கள்!
The four pillars of OOP: Encapsulation, Inheritance, Polymorphism and Abstraction. Interviewers ask about them often!