In object-oriented programming, a 'base class' is a class from which other classes have been derived (http://en.wikipedia.org/wiki/Base_class).
However, what is the opposite of a base class? In order words, what is a class that does NOT have any child classes called?
EDIT: I am looking for the name of a class that has not been sub-classed, YET, within an inheritance of tree of multiple parent classes, starting with a base class.
What is a Base Class? In an object-oriented programming language, a base class is an existing class from which the other classes are determined and properties are inherited. It is also known as a superclass or parent class.
Definitions: A class that is derived from another class is called a subclass (also a derived class, extended class, or child class). The class from which the subclass is derived is called a superclass (also a base class or a parent class).
A base class is also called parent class or superclass. Derived Class: A class that is created from an existing class. The derived class inherits all members and member functions of a base class. The derived class can have more functionality with respect to the Base class and can easily access the Base class.
A base class may also be called parent class or superclass.
A base class is a relative term. It only applies when considering one of its derived classes. Here are some terms that I consider opposites (and mostly orthogonal among themselves):
Abstract and (normally) root classes are designed to be base classes. Sealed classes cannot be base classes, because they're non-inheritable. A root class is a class without a base class (in C# and Java, this class is Object
). A leaf class has no subclass, so it's not a base class; but it's not necessarily sealed. Sealed classes, on the other hand, are always leaf classes.
So,
I am looking for the name of a class that has not been sub-classed, YET
It seems that you're looking for a leaf class, but I don't consider it to be the opposite of a base class.
I usually hear leaf class. Java enforces it with final
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With