What is the difference between inheritance and subtyping?
Subtyping is a relation between (object) types, having to do with keeping track of the messages that objects can accept. Inheritance is a relation between classes, having to do with the superclass-subclass relation and with method reuse. The usual connection between inheritance and subtyping is the following: a subclass generates objects whose type is a subtype of the objects generated by a superclass. Initially, object-oriented languages confused classes with object types, and therefore ended up blurring the distinction between implementations (classes) and interfaces (object types), and between inheritance (code sharing) and subtyping (interface sharing). Recent object-oriented languages are designed to make these distinctions and to take advantage of them. For other basic questions, see the Object-Orientation FAQ: US, EU(http://cuiwww.unige.ch/OSG/OOinfo/FAQ/oo-faq-toc.html).