Abstraction - hiding implementation using abstract class and interfaces etc.
Abstraction represent taking out the behavior from how exactly it’s implemented.
Example: Abstraction in Java is interface.
Encapsulation - data hiding
While Encapsulation means hiding details of implementation from outside world so that when things change nobody gets affected.
Example: Java is private methods.
No comments:
Post a Comment