[[Inheritance (computer science)|Inheritance]] is typically done by grouping objects into ''classes'', and defining [[class (computer science)|class]]es as [[Extension (semantics)|extension]]s of existing classes, and thus grouping classes into ''trees'' or ''lattices'' reflecting behavioral commonality. Although the use of classes is the most popular technique for inheritance, another well-known technique is prototype-based programming.
In statically-typed class-based OO languages (such as [[Java (programming language)|Java]], [[C Sharp (programming language)|C#]], [[C++ (programming language)|C++]] and [[Scala (programming language)|Scala]]) -- usually also called [[Nominative type system|nominally-typed]] OO languages -- class/interface inheritance and class/interface subtyping (i.e., the substitution of objects of a class for objects of another class) completely agree. In nominally-typed OOP, inheritance ''is'' subtyping.<ref name="NOOP">AbdelGawad, Moez. ''NOOP: A Mathematical Model of Object-Oriented Programming'', Doctoral Thesis, Rice University, 2012. http://scholarship.rice.edu/handle/1911/70199</ref>