what is data Abstraction? and give example
Answers were Sorted based on User's Feedback
Answer / gaurab varshney
Data Abstraction is the process by which data and programs
are defined with a representation similar to its meaning
(semantics), while hiding away the implementation details.
Abstraction tries to reduce and factor out details so that
the programmer can focus on a few concepts at a time. A
system can have several abstraction layers whereby
different meanings and amounts of detail are exposed to the
programmer.
For example, low-level abstraction layers expose details of
the hardware where the program is run, while high-level
layers deal with the business logic of the program.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sachin
Data Abstraction is the process which represent essential
feature without implementation of details.
Ex. Soccer Ball, Ball is having same structure behavior
like common ball
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / amit singh
Data abstraction is the process of showing necessary
details to the user by hiding the complexity behind them.
real time ex-
T. V remote control we can see the buttons on it but how
the circuitry work after pressing the particular button is
hidden from the user.
even as per java code we can give ex of abstract class
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ravin
data abstraction is a method to represent essential features of a data without including background details or unimportant matter.
a function/process used to define the use of this data.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / swati
data abstraction denote essential feature of an object.. in abstraction make only relivent detail of an object.
example- when u want to snd an e-mail msg,u should know the process of writting e-mail,snding it to the recievr.however it is not necessary for u to know the entire process of sending the emil msg across the n/w
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / apoorva
It is the process of hiding the complexity and inner
workings of a class, so that users dont have to know how it
operates.
For example- You dont have to know how a tv works if you
only wanted to view a picture.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / deep shah
"Abstraction refers to the act of represent essential features without including the background details or explanation".
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / v.santhoshini
*Data Abstraction is a collection of related data items
together with an associated set of operations.
*data operations &relations are studied indpendent of
implementation.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / abelthom
data abstraction is the process of looking at the data at
higher levels without being concerned with the lower levels
(i.e. implementation considerations)
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sankalp
abstraction - it is the act of representing the essential features without including the background details.
classes uses the concept of abstraction.
Benefits of Data Abstraction:
Data abstraction provide two important advantages:
Class internals are protected from inadvertent user-level errors, which might corrupt the state of the object.
The class implementation may evolve over time in response to changing requirements or bug reports without requiring change in user-level code.
By defining data members only in the private section of the class, the class author is free to make changes in the data. If the implementation changes, only the class code needs to be examined to see what affect the change may have. If data are public, then any function that directly accesses the data members of the old representation might be broken.
Data Abstraction Example:
Any C++ program where you implement a class with public and private members is an example of data abstraction. Consider the following example:
#include <iostream>
using namespace std;
class Adder{
public:
// constructor
Adder(int i = 0)
{
total = i;
}
// interface to outside world
void addNum(int number)
{
total += number;
}
// interface to outside world
int getTotal()
{
return total;
};
private:
// hidden data from outside world
int total;
};
int main( )
{
Adder a;
a.addNum(10);
a.addNum(20);
a.addNum(30);
cout << "Total " << a.getTotal() <<endl;
return 0;
}
When the above code is compiled and executed, it produces following result:
Total 60
| Is This Answer Correct ? | 1 Yes | 0 No |
How would you differentiate between a pre and post increment operators while overloading?
What is ios class in c++?
how to connect with oracle 9i with server in socket program in c/c++
Explain 'this' pointer and what would happen if a pointer is deleted twice?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
What are the uses of pointers?
Badboy is defined who has ALL the following properties: 1. Does not have a girlfriend and is not married. 2. He is not more than 23 years old. 3. The middle name should be "Singh" 4. The last name should have more than 4 characters. 5. The character 'a' should appear in the last name at least two times. 6. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
Difference between declaration and definition of a variable.
What jobs can you get with a c++ certification?
What kind of jobs can I get with c++?
Write a C++ Program to Multiply two Numbers
What is the difference between stack and heap memory?