What is inheritance?
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
In object-oriented programming, classes can inherit data and methods from other classes. So, some or all the data or methods of the super class are inherited by the derived class.
Note that the opposite is not true. A super class cannot inherit the data or methods of its derived class. Derived classes can also define their own data members and methods. Inheritance promotes code reuse.
A derived class can inherit all the non-private data members, properties, methods, and events of a super class.
A super class itself might be a derived class that extends its own super class. This forms a class hierarchy with super class and subclass relationships.
A special type of super class is an abstract class, which is used as a template for a set of derived classes. You cannot create an instance of an abstract class.