Data encapsulation: The wrapping up of data and function into a single unit (called class) is known as encapsulation. The data is not accessible to the outside world, and only those functions which are wrapped in the class can access it. These functions provide the interface between the object‟s data and the program. Encapsulation is a mechanism that keeps the data and code safe from external interference and misuse. This insulation of the data from direct access by the program is called data hiding or information hiding.
Data abstraction: Abstraction refers to the act of representing essential features without including the background details or explanation. Data abstraction is the process of defining a data type, often called abstract data type (ADT), together with the principle of data hiding. Classes use the concept of abstraction. They encapsulate all the essential properties of the object that are to be created. The attributes are called as data members as they hold information. The functions that operate on these data are called as member functions.