Chemistry, asked by venkatKota601, 1 year ago

difference between abstraction and encapsulation

Answers

Answered by kvnmurty
1
Computer Science:
   Abstraction means representing an object/class in relation to what it does to clients or outside world.  So the methods or functions which are public ie., the public interface is what is important here.  The implementation details of how the functions are achieved is hidden from the client.  Abstraction can be done at multiple levels - classes, sub classes etc..  There is no reference to the state of the objects here.

   Encapsulation refers to the state of the object.  means putting together the state (property) of the object along with methods to access the state.  This can be done with different ways of access modifiers ie., public, private and protected.  Essentially, the state of the object is hidden from the outside view of the object by encapsulation.  There is data access security here.  Encapsulation refers to implementation of the class and its interface.

   Encapsulation comes after the abstraction process is first done.  Encapsulation is part of abstraction process. 

Answered by MrTSR
0

\bold{Answer:-}

Difference between Abstraction and Encapsulation.

\bold{Answer:-}

>Abstraction hides the unecessary details of the object.

>It implements in C++ using abstract class and public acess specifier.

>Abstraction focuses on the outside view of an object.

>Abstraction is more about 'What' a class can do [Idea]

_________________

>Encapsulation binds data and methods in a unit.

>It implements in C++ with help of classes.

>Encapsulation prevents client from seeing it's inside view.

>Encapsulation is more about 'How' to achieve that funcationality [Implementation]

Similar questions