+ 3
what is the difference between encapsulation and abstraction?
5 odpowiedzi
+ 6
Encapsulation is wrapping data and functionality(methods accessing data) together thus hiding data from user.
Abstraction is to hide implementation details from user. Abstraction is more about what object can do rather than how it does it..
+ 2
...What is the common point between them?
Encapsulation is about hiding the implementation from the outside, abstraction is about reducing something to the properties we are interested in.
+ 2
Abstraction is showing the relevant data only.. And encapsulation is hiding the data..
+ 2
Abstraction is hiding implementation details(of a method) n is generally done using abstract classes and interfaces while encapsulation is hiding data (data members) using access modifiers like private and protected.
0
So the abstraction is showing the minimum required relevant data. but the encapsulation is hiding the data from the outside.