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 |
Brief explaination about #include<iostream.h>, cin and cout
Is rust better than c++?
Do we have to use initialization list in spite of the assignment in constructors?
Explain deep copy?
Explain mutable storage class specifier.
Ask to write virtual base class code?
What is a constructor and how is it called?
What is the output of the following 3D Array int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12}; what is the output for arr[2][1][0]?
6 Answers HCL, Integra, IPMC, ORG,
difference between the c++ and c languages
Can manipulators fall in love?
Where must the declaration of a friend function appear?
How new/delete differs from malloc()/free?