2014年8月31日日曜日

Abstraction and Encapsulation


Abstraction:
Abstraction refers to the act of representing essential features without including the background details or explanations. 

Classes use the concept of abstraction and are defined as a list of abstract attributes.

 Encapsulation:
It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. 

In short, it isolates a particular code and data from all other codes and data. 

A well-defined interface controls the access to that particular code and data. 

The act of placing data and the operations that perform on that data in the same class. 

The class then becomes the 'capsule' or container for the data and operations.

Storing data and functions in a single unit (class) is encapsulation. 

Data cannot be accessible to the outside world and only those functions which are stored in the class can access it.

0 件のコメント:

コメントを投稿