A value of a subtype can be substituted for a value of a supertype.

Related concepts:  TypePolymorphismInheritance

Closest Wikipedia entry:  Subtyping — In programming language theory, subtyping (also subtype polymorphism or inclusion polymorphism) is a form of type polymorphism in which a subtype is a datatype that is related to another datatype (the supertype) by some notion of substitutability, meaning that program elements, typically subroutines or functions, written to operate on elements of the supertype can also operate on elements of the subtype. If S is a subtype of T, the subtyping relation is often written S <: T, to mean that any term of type S can be safely used in a context where a term of type T is expected. The precise semantics of subtyping crucially depends on the particulars of what "safely used in a context where" means in a given programming language.

Misconceptions about Subtyping
11 documented Misconceptions

Check Yourself

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.