What Does Subtyping Mean?
Subtyping is a notion in programming language theory where a subtype, which is a data type, is related to a supertype based on the notion of substitutability, where program elements such as functions and subroutines that are written for the supertype will still operate if given the subtype instead. Subtypes are an essential concept in object-oriented programming and are substitutable to supertypes and sometimes even have more stringent specifications than the supertype.
Techopedia Explains Subtyping
Subtyping is a method for substitution and code reuse used in object-oriented programming languages to prevent unnecessary copying of largely similar code and promote code readability and prevent bugs. A subtype is basically a substitute for a supertype that can fulfill all of the latter’s specifications, and then some. So if B is a subtype of A, then B can always be used to substitute for an A and any property that is guaranteed by A must also be guaranteed by B.