Reputation: 1127
What is the 'official' name of a class in OOP that has child classes but no parent classes?
Is it a 'base class' or a 'root class' or something else?
According to http://en.wikipedia.org/wiki/Base_class - a 'base class' is a class from which other classes have been derived. However, it is not clear if a base class in OOP can have parent classes.
Upvotes: 0
Views: 434
Reputation: 2050
A "base class", by definition, has no parent class. It's the superclass to all other classes.
For example, in Java, the Object
class is the base class.
[Edit] It looks like there is no definite consensus on the question thus, and the current revision on Wikipedia states that "base class" is just another synonym for "superclass". So I guess there is no answer to your question, or multiple ones. Was it purely rhetorical or did you have a more precise question in mind ?
Upvotes: 1
Reputation: 9324
It is usually called a "root class," or more precisely, "root of the class hierarchy."
In almost all OO languages, there is only one such class. In Ruby, it is SimpleObject; in Java, Object. If a language allowed multiple parentless classes — i.e. didn't have an implicit "Object" parent class — I would hesitate to use the term "root."
Upvotes: 1
Reputation: 1216
I'm not aware of any particular "official" name. The MSDN page for System.Object simply states:
Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy.
Upvotes: 2