answersLogoWhite

0


Best Answer

Data abstraction simply describes the difference between an object's concrete implementation and its abstract interface. Clients do not need to know how an object works in order to use it, they only need to know what it does. As a real world example, a user does not need to understand how electrical energy can be transformed into light energy, they only need to know that flicking a switch will turn the light on and off. That is, the switch provides the interface; everything the user needs to know in order to use the light. The implementation details are not important to the user.

In a computer program, we use data abstraction in order to simplify an object's physical representation, exposing only what we need to expose (no more and no less) through an abstract interface whilst keeping the actual implementation details safely tucked away.

As an example, a variable-length array requires at least three pieces of information: the start address of the array, the number of used elements in the array and the number of unused elements in the array. When the programmer wants to add a new element, they must first check to see if there are any unused elements. If not, the array must be reallocated with a new reserve. Then the programmer can add the new element, increment the used element count and decrement the unused element count. And they must do that every time they add a new element.

But these implementation details are not important to the programmer; they simply want to add a new element. The array itself should be responsible for the underlying implementation, not the programmer. And that's where data abstraction comes in. In object oriented programming we use vectors rather than variable length arrays. They both do exactly the same job equally efficiently, but vectors are much easier to work with. The programmer can concentrate on actually using the object rather than concerning themselves with the mundane, repetitive and error-prone activities related to the object's underlying memory management. Those implementation details are safely abstracted away behind the object's interface.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is meant by data abstraction An example that would be used in a program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


What is a semantic program?

I would assume that it is a type program that is not fully functional yet. It would be a program that could derive meaning from a symbol and apply it to different symbol with similar meaning. For example, if the program took in the word cat, then should be able to return pictures, stories, and fact about cats.


What is meant by degree of subcooling?

The degrees (temperature) from the saturated liquid line. One example would be after refrigerant goes through a condenser. T_subcooling = T_sat - T_condenser


Why would you need to convert a string to a numeric data type?

For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.


What is the difference between data and programs?

Data is the information that a program will act upon. For example, your data might be all of your financial records for the past year, and the program would be some piece of tax software. The program will act upon your data so that the appropriate numbers are placed in the appropriate fields on your tax return.

Related questions

What is example of abstract?

The best means subjectively to the readers. An abstraction is good only the readers can grasp what it means (seems every instance that the reader can think of fits to the description/abstraction), but cannot create one instance from it directly. For example, Cat, is a good abstraction, Human Being, is another one. Every instance (in your mind when you see those words) fit the abstraction, but you cannot use that term to create an instance. I would argue that there are "Better Abstraction" only, there is no "best" (yet)


What is meant by the abbreviation DVP?

DVP could mean a host of things. For example Distinguished Visitor Program, Disabled Veterans Program or Digital Video Programs. Now if a person knew what field they were checking out it would narrow down more closely to what DVP meant in that particular area.


What is memory abstraction?

Memory abstraction would involve separating certain memories, or pieces of them from something else.


What is meant by presentation program?

My guess, without seeing it in context, would be Microsoft PowerPoint


Why did you apply for this program?

There are many reasons why a person would apply for a program. They may want to learn more about the program for example.


What would one use to identify at the top of the ladder of abstraction?

feelling or intuition


What would one use to identify elements at the top of the Ladder of Abstraction?

feelling or intuition


What is a continent on africa?

Africa is a continent. Perhaps you meant a country, in which an example of an African country would be Mozambique.


Rhetorical device where the speaker addresses an absent person an abstraction or an inanimate object?

That would be apostrophe.


What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


Could you play Roblox.com in your PSP?

No, sorry. You would have to download a program meant for computers but you will run it on your PSP and it will crash and you will have to buy another one.


What is the post-bac program?

I believe it is the credential program you would take. For example to be a teacher you must have your credentials, in order to get your credentials you must complete the post bac program. hence the word post ( program after you get your bacherlors degree)