ABSTRACTION VS ENCAPSULATION

Abstraction : this is a design time process.
It includes showing only essential details to user rather than other complex details....

Example : In ATM,
what we do is use ATM,
 enter pin and withdraw money.
User need to not to know what complex things are happening inside. This is called Abstraction.


Encapsulation : This is coding thing.
In this, we do hide properties and behaviour from
outside world so as to have security.
 For example, when we have class Stack and its method Push(), pop().
Now using class we can invoke these methods and utilise functionality without
caring about how are these methods are implemented inside i.e. we are hiding push() implementation
and just letting it be used for push operation.

Comments