Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Inheritance, subclass, overriding?

Ook bekend als: subclass · inheritance · overriding

Definition 23.6 High School Computer Science · Hoofdstuk 23 — Classes and Objects

A subclass is a class defined from another, its base class, by inheritance: it has all the base class’s methods, and may add others. A method of the subclass with the same name as one of the base class overrides it: it replaces it for the instances of the subclass.

The classes of shapes.py. An arrow goes from a subclass to its base class. describe is inherited by all; area is overridden; Square only changes the constructor, through super().
The classes of shapes.py. An arrow goes from a subclass to its base class. describe is inherited by all; area is overridden; Square only changes the constructor, through super().
Lees in het hoofdstuk →