Mapa mental
Inheritance
Contenido del mapa
Inheritance
An important feature in OOP used to extend a class.
- Parent-Child relationship between classes
- The child class can be extendable until you declare it as "final"
- Use "final" keyword to prevent classes from being subclassed or extended.
- The child class can be extendable until you declare it as "final"
- Use the "extends" keyword after class name and before parent class.
- Example: public class Child extends Parent{}
- Parent-Child relationship between classes
Allows you to change behaviors of an existing class to better suit your need s.
Multiple inheritance is allowed in C++ unlike JAVA.
The "is-a" relationship is a special relationship between the subclass and the superclass.
- Superclass being a big class and the subclasses are the different types of the superclass.
- A subclass inherits all public methods and fields from the superclass.
- Must not assign an instance of a subclass to a reference variable of the parent type.
Información
- Descripción
- Mapa Mental sobre Inheritance, creado por Jada Matthews el 21/11/2019.
- Creado por
- Jada Matthews
- Visitas
- 0
- Valoración