C++: Difference between abstraction and encapsulation in c++
I have seen some answers on this topic but I want to know the difference by an example which relates to the theoretical concept of these topics.
C++: Difference between abstraction and encapsulation in c++
I have seen some answers on this topic but I want to know the difference by an example which relates to the theoretical concept of these topics.
Abstraction is hiding the elements by making them private and/or proteceted in C++ in classes( basically structures too) so that they are secure and cannot be accessed from outside the class easily.
Encapsulation is combining of the data members and methods(functions) into a single entity, called Class. Encapsulation and abstraction are inter-related. Encapsulation implements abstraction.