Hierarchical class terms, ancestors of the parent class

I try to understand the various definitions; other students do not quite agree with me.

My definitions, please correct them if they are wrong:

The base class is the largest class in the hierarchy.

Super and Ancestor class, any class above in the hierarchy (including base class)

Parent class, next class in the hierarchy.

+6
source share
2 answers

Yes. Parent classes are direct superclasses (up to one level in the hierarchy) of your class. A class may have several parents, depending on your programming language.

While the ancestor class is any superclass of your class (parent class, parent element of the parent class, etc.).

+5
source

According to the definition of wikipedia, a base class is any class from which another class inherits one or more properties or methods. If you accept this definition, it means that the super, ancestor, parent and base classes are synonymous with each other in terms of describing the relationship of a class with a particular subclass.

+1
source

Source: https://habr.com/ru/post/917861/


All Articles