Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Inheritance, subclass, overriding?

Também chamado de: subclass · inheritance · overriding

Definition 23.6 High School Computer Science · Capítulo 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().
Ler no capítulo →