jQuery in Action, 2nd edition*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 11153
    
  16

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: abstraction in java
 
Similar Threads
oops
Abstraction
Abstraction
Data Abstraction
CS/Engineering Terminology and Compromises in Modeling