| Author |
Difference b/w Abstraction and Encapsulation
|
Senthil KumarR
Greenhorn
Joined: Mar 09, 2009
Posts: 5
|
|
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
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
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.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Senthil KumarR
Greenhorn
Joined: Mar 09, 2009
Posts: 5
|
|
Thanks Wouter...
|
 |
 |
|
|
subject: Difference b/w Abstraction and Encapsulation
|
|
|