Explain the concept of abstracion and encapsulation with
one example. What is the difference between them?
Answer Posted / aarti ashar
(1)Abstraction:
To implement real world entity into program. Class uses the
concept of abstraction.
->abstraction is a process of mimicking a behavior.
->Simplifying complex reality by modeling classes
appropriate to problem.
->Abstraction is a process that involves identifying the
crucial behavior of an object and eliminating irrelevant
and tedious details.
(2)Encapsulation:
->Binding the data and code to access that data.
Encapsulation only refers to a container which has a data
and its related functions in it.
->When an objects state and behavior are kept together they
are encapsulated. The data and the methods that manipulated
that data are stored together in cohesive unit.
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
Can abstract class have normal methods?
Why do we need oop?
When not to use object oriented programming?
What are the components of marker interface?
write a C++ program for booking using constructor and destructor.
What is overriding in oops?
What is interface in oop?
can we make game by using c
Can destructor be overloaded?
How is class defined?
Why is static class not inherited?
Which language is not a true object oriented programming language?
Why is object oriented programming so hard?
State what is encapsulation and friend function?