aspose file tools*
The moose likes Beginning Java and the fly likes question abt data abstraction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "question abt data abstraction" Watch "question abt data abstraction" New topic
Author

question abt data abstraction

hem kumar
Ranch Hand

Joined: Sep 05, 2005
Posts: 97
hey can anybody explain me abt data abstraction in java with a practical example.... Thank u.


.....For Every Problem There Is a Solution.....
Regards, Hem
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
There are a couple ways to look at abstraction. One is ignoring a certain level of detail so you can focus on another level. For example if my system deals with people, I might have a Person object, aka a Person abstraction. We can talk about Person without having to describe all the name, birthdate and address fields every time I mention it.

Another side of abstraction is a truly abstract class or interface. I might have an abstract Person class with concrete classes like Manager and Employee. Have you run into any examples like that?

Does that help?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
hem kumar
Ranch Hand

Joined: Sep 05, 2005
Posts: 97
can u plz give me a programme code where abstraction is involved?? thank u
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
It's as simple as something like:

Date is a fairly "abstract" concept when you consider the details: month, day, year, hours, minutes, seconds, millis, day of week, leap year, holidays and so on. You can use the word "date" in a conversation or the class Date in code without getting hung up on all those details.

Does that kind of explanation fit the question? If this is for homework we might have to figure out exactly what the question was supposed to mean.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Even "int i = 10;" is an abstraction. I say this because there are a lot of details that go on here that most programmers are not aware of, and don't need to be.

Of course, in an Object Oriented language, typically "abstraction" refers to using classes like Stan described.

Layne


Java API Documentation
The Java Tutorial
Naveen Vooka
Greenhorn

Joined: Oct 13, 2004
Posts: 25
http://cnx.rice.edu/content/m11785/latest/
http://en.wikipedia.org/wiki/Abstraction_%28computer_science%29

--------------
Naveen Vooka
www.devsquare.com
DevSquare - Online Application Development
hem kumar
Ranch Hand

Joined: Sep 05, 2005
Posts: 97
thank u stan, lyne and naveen for helping me out....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: question abt data abstraction