Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class hierarchy terms, ancestor- vs. parent-class

Tags:

oop

Im trying to understand the various definitions, other students do not quite agree with me.

My definitions, please correct them if wrong:

Base class is the top most class in the hierarchy.

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

Parent class, the next class up in the hierarchy.

like image 779
Pétur Ingi Egilsson Avatar asked Jun 12 '12 08:06

Pétur Ingi Egilsson


1 Answers

Yes. Parent Classes are the direct superclasses (up to one level in the hierarchy) of your class. Depending on your programming language, a class can have multiple parents.

While an ancestor class, is any superclass of your class (a parent class, a parent of a parent class and so on).

like image 68
user278064 Avatar answered Nov 07 '22 13:11

user278064