Module 7 Flashcards
(15 cards)
Allows one class to inherit properties and methods from another class.
INHERITANCE
Allows a software developer to derive a new class from an existing one
Inheritance
Also called derived class or subclass
Child class
Also called Base class or Superclass
Parent class
A class that is used as a starting point for creating derived classes.
Base Class
A class that is created by inheriting properties and methods from a base class.
Derived Class
Inheritance promotes code reuse by allowing child classes to inherit properties and methods from a parent class. This can save time and effort by reducing the need to write redundant code.
Code reuse
This can help to organize and structure code, making it easier to understand and maintain.
Hierarchical relationships
Allows objects of different classes to be treated as if they were of the same class, which can lead to more flexible and extensible code.
Polymorphism
Inheritance can make code easier to maintain and update. If a change is made to a property or method in a parent class, the change will automatically be inherited by all child classes that use that property or method.
Easy maintenance
Inheritance can help to create a better design for software systems by promoting modularity and encapsulation. This can make it easier to understand and modify code, and can lead to more robust and scalable software.
Better Design
keyword is used to create a subclass that inherits properties and methods from a superclass
extend
a reference variable that is used to refer to the immediate parent class of a subclass. It is often used to call a method in the superclass that has been overridden by the subclass.
super
A feature of object-oriented programming where a subclass provides its own implementation of a method that is already defined in its parent class
Method Overriding
Is another feature of object-oriented programming where multiple methods can have the same name, but with different parameters.
Method overloading