jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Oops concept Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Oops concept" Watch "Oops concept" New topic

Oops concept

vibhas karn

Joined: Aug 11, 2008
Posts: 26
Can anybody explain me the difference between abstraction and encapsulation twith real life example. I am really confused with this.
marc weber

Joined: Aug 31, 2004
Posts: 11343

See the topic, difference between abstraction and encapsulation.

(A Google search on "java abstraction encapsulation" also yields some good results.)

If you're still stuck, tell us exactly what you're confused about.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
vibhas karn

Joined: Aug 11, 2008
Posts: 26
Ok what i understood is abstraction tells you "what the system is doing" and not how it is doing. That is you are not bother about the implementation details how the systems works. Similarly Encapsulation hides the implementation details from the user. So the implementation details is the main problem for me in abstraction you dont bother about the implementaion and in encapsulation you are not allowed to know the implemenation. Both these things seems very much confusing to me. Can you give me some real life example so that i can judge the difference.
I agree. Here's the link: http://aspose.com/file-tools
subject: Oops concept
It's not a secret anymore!