>

Thursday, 17 December 2015

Data Encapsulation

Wrapping up of member data and member functions together in a class is called data encapsulation.
The concept of data encapsulation is supported in C++ through the use of the public, protected and private keywords which are placed in the declaration of the class. Anything in the class placed after the public keyword is accessible to all the users of the class; elements placed after the protected keyword are accessible only to the methods of the class or classes derived from that class; elements placed after the private keyword are accessible only to the methods of the class.

0 comments:

Post a Comment