File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference b/w encapsulation vs abstraction

 
sharma sachin
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello to all
can any one explain me in detail with real world example as well as with the help of program
the difference between data abstraction and data encapsulation.

and make me right if i m wrong:
according to me data encapsulation is data hiding
and data abstraction is providing the essential details of an object by ignoring the irrelevant details of an object.
in my opinion abstraction and encapsulation goes side by side i.e whenever there is encapsulation there must be the abstraction
for ex: playing pc games, withdrawing money from ATM.

ex of program

please take me out of this question if i had given wrong answer because it is the very basic concept and i want to clear this concept as soon as possible
 
Jim Hoglund
Ranch Hand
Posts: 525
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Encapsulation is all about handling the details, of a bank account, for example.
The attributes of a bank account (e.g. owner, type, bank, balance, transaction
dates, etc.) are encapsulated in a class where operations can be performed on
them. The associated abstraction is the concept of a bank account. It is useful
when discussing bank accounts more generally; new accounts, accounts closed
this month and so on. An abstraction is a summary label for a set of details that
are encapsulated.

Jim ... ...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic