Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question abt data abstraction

 
hem kumar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey can anybody explain me abt data abstraction in java with a practical example.... Thank u.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
hem kumar
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u plz give me a programme code where abstraction is involved?? thank u
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Naveen Vooka
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank u stan, lyne and naveen for helping me out....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic