aspose file tools*
The moose likes Beginning Java and the fly likes abstraction in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "abstraction in java" Watch "abstraction in java" New topic
Author

abstraction in java

wrushasen dakhane
Ranch Hand

Joined: Sep 25, 2006
Posts: 47
How to implement abstraction in java?

Please help me out with the simple definition and sample code to support that.

Wrushu


SCJP 1.4, SCWCD 1.4
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10909
    
  12

What do YOU think abstration is? What has your research shown? If you tell us what you think, we can correct you. You'll learn much more this way.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
wrushasen dakhane
Ranch Hand

Joined: Sep 25, 2006
Posts: 47
I just think abstraction means hidding the data.

Not giving the full access to the object entities.

But now I have the confusion here, then how the abstraction is different from encapsulation?

Wrushu
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

What you've described is "encapulation" (or data-hiding).

An example of "abstraction" is the implementation of a Fruit class:

Fruit: an example of abstraction

Both encapsulation and abstraction are benefits of object-oriented programming.

Kaydell
[ June 20, 2007: Message edited by: Kaydell Leavitt ]
 
Don't get me started about those stupid light bulbs.
 
subject: abstraction in java
 
Similar Threads
oops
CS/Engineering Terminology and Compromises in Modeling
Abstraction
Data Abstraction
Abstraction