Answers were Sorted based on User's Feedback



what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

what is data Abstraction? and give example..

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

Post New Answer

More C++ General Interview Questions

What is a down cast?

0 Answers  


an operation between an integer and real always yeilds a) integer result b) real result c) float result

0 Answers  


Can a constructor throw a exception? How to handle the error when the constructor fails?

1 Answers  


Difference between shift left and shift right?

1 Answers   Symphony,


What do you understand by zombie objects in c++?

0 Answers  






Explain how an exception handler is defined and invoked in a Program.

0 Answers  


What is setiosflags c++?

0 Answers  


Explain differences between new() and delete()?

0 Answers  


Out of fgets() and gets() which function is safe to use?

0 Answers  


Describe exception handling concept with an example?

0 Answers  


Explain the properties and principles of oop.

0 Answers  


Why should you learn c++?

0 Answers  


Categories