Inheritance is a core Object-Oriented Programming concept where one class inherit properties(fields) and behaviour(methods) from another class. It uses "extends" keyword to establish a Is-A Relationship, allowing us to reuse the existing code and build hierarchical classification...
Key Terminologies
Super Class (Parent class): It is a existing class whose features are inherited by another class.
Sub Class (Child class): It is a new class inherits methods and fields from super class and can have its own unique features.
extends (Keyword): It's a keyword used by sub class to inherit from super class...
Top comments (0)