Forums Register Login

Difference b/w Abstraction and Encapsulation

+Pie Number of slices to send: Send
Hi All,

We all know basic OO concepts are:
1) Abstraction
2) Encapsulation
3) Inheritance
4) Polymorphism

I need to know the difference or the concept of Abstraction and Encapsulation.

They seem to be very confusion.

Please help.

Thanks
+Pie Number of slices to send: Send
Abstraction is to hide/reduce implementation detail. The use of an interface is an example.
You know how to use it but you don't know the implementation details. Another example is
the iterator pattern. With that pattern you can hide the data-structure without compromising
it's accessibility.

Encapsulation is the process in which internal variables are hidden and made accessible by
certain methods.
+Pie Number of slices to send: Send
Thanks Wouter...
pie. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1871 times.
Similar Threads
Abstraction
Difference between encapsulation and abstraction
encapsulation & abstraction
Encapsulation/Abstraction
Difference between encapsulation and abstraction
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:41:06.