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


Please Help Members By Posting Answers For Below Questions

What is polymorphism in oop example?

521


What is difference between inheritance and polymorphism?

577


write a program that takes input in digits and display the result in words from 1 to 1000

1995


Whats oop mean?

601


Why oops is important?

616






What is the fundamental idea of oop?

641


What is a class in oop?

608


Get me an image implementation program.

1563


What is the renewal class?

2171


What is persistence in oop?

677


What are the two different types of polymorphism?

677


Why interface is used?

555


What is this pointer in oop?

557


How do you define social class?

605


What does enum stand for?

617