Encapsulation in c#

C# Tutorial - Encapsulation




Encapsulation

In an Object Oriented programming language, encapsulation is one of they key language features. 


Encapsulation is the process of encapsulating the data and cross ponding method  into the single module.

i.e. -  Enclosing the one or more details out side the world access right.

if any .NET class follow the data hiding and abstraction such type of class is encapsulated class

Ex - Bluetooth is the transfer data one mobile to another mobile phone with limited distance, If turn on Bluetooth both of the mobile they can transfer desire data , I can't access other mobile data like Gallery, Phone call number etc.. data unless getting the permission 



Encapsulation is defined as a wrapping data under single unit.


The purpose of encapsulation is to prevent alteration of data from outside. This data can only be accessed by getter functions of the class.