In other words, a subclass is a description of a class based on the structure of another class.
Some programming languages also allow a class to have multiple parents.
Subclasses and classes are used in object-oriented programming (POO).
Subclass characteristics
A subclass inherits certain characteristics of the parent class/s is like an extension of this, and even new features of the parent class can be redefined or added.
A subclass inherits the state and behavior of all their ancestors.
The term superclass refers to the class that is the most direct ancestor, as well as to all ascending classes.
One of the mechanisms by which a subclass obtains the behavior (methods) and attributes (variables) of its superclass is called inheritance, but it cannot be said that a subclass is always an inheritance, because the subclass could redefine all of its superclass, so nothing would be inherited in that case.
Related terminology
• Class (programming)
• Object-oriented programming
• Inheritance (programming)
Questions? needs more information?
Write and we will respond to your email
Comments
Post a Comment