Possible Duplicate:
Abstraction VS Information Hiding VS Encapsulation
I know this question might have been asked thousands times on this forum, even net is also filled with lots of definitions about these concepts but all sounds same and all uses same technical words. For example following definitions
Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper.
What I understood from above definition is that creating variables, mark them private and generate getter-setter for those variables and use object to access those getter and setter. In that way data is hidden inside object and is only accessible through object. Hope I am right.
Abstraction is the process in Java which is used to hide certain details and only show the essential features of the object. In other words, it deals with the outside view of an object (interface).
Now this is the part which confuses me always. Whenever I think about abstraction the thing which comes to my mind is Abstract class(may be because both have Abstract keyword). Above definition says abstraction means hiding data and only showing required details but that is what we are already doing in encapsulation right? then what is the difference. Also I did not get what is out side view of object in it deals with the outside view of an object.
Can someone please put more light on this with some real life example or with some programmatic examples if possible.