Encapsulation vs Inheritance - What's the difference?
encapsulation | inheritance |
The act of enclosing in a capsule; the growth of a membrane around (any part) so as to enclose it in a capsule.
Grouping together an object’s ‘state’ (its data) and the operations that may alter or interrogate it (its methods).Huw Collingbourne, The Book of Ruby'', ''‘Encapsulation’ or ‘Information Hiding’? , page 140
(label) The process of arranging data into packets that can be transmitted using a given protocol.
----
The passing of title to an estate upon death.
(lb) That which a person is entitled to inherit, by law or testament.
(lb) The biological attributes passed hereditarily from ancestors to their offspring.
In object-oriented programming, the mechanism whereby parts of a superclass are available to instances of its subclass.
