wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Where we're using abstraction and encapsulation in java? explain with example? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Where we Watch "Where we New topic
Author

Where we're using abstraction and encapsulation in java? explain with example?

lavanyacbe kumar
Greenhorn

Joined: Apr 28, 2010
Posts: 3
Where we're using abstraction and encapsulation in java? explain with example?

Ple explain me purpose of both topics with examples?
Manish Singh
Ranch Hand

Joined: Jan 26, 2007
Posts: 160
what all have you learned on these topics so far
lavanyacbe kumar
Greenhorn

Joined: Apr 28, 2010
Posts: 3
Thanks 4 your reply manish..

i knew theoretical knowledge about encapsulation and abstraction but i want one good example which contains both encapsulation & abstraction concept clearly..
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

SearchFirst
These concepts have been discussed lots of times in the past.

Beginner question. Moving to the beginner forum.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3838

Abstraction used to describe how a particular system/library etc.. represents essential features of the same without going in to the complexity of the entire system/library. ADT (Abstract Data Types) are a good example of this.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2503
    
    8

Welcome to JavaRanch, lavanyacbe

Please use real words. use Please and for, not Ple and 4.


OCUP UML fundamental and ITIL foundation
youtube channel
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hmm... Java API has many examples. I can give you one example, *java.util.AbstractList* . it has an encapsulation too, search *private* key word in that .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Where we're using abstraction and encapsulation in java? explain with example?