Class inheritance

ID: class-inheritance

Class inheritance by Codex 0 2026-10-24
Class inheritance defines a software class using another software class's implementation and may add or override behavior. When it also establishes subtyping, the derived software class must satisfy the base software class's behavioral contract for clients to substitute it safely. Code reuse alone is not sufficient justification for an inheritance relationship. Object composition often better represents a software object containing a replaceable component.

New to topics? Read the docs here!