Encapsulation is a combination
of 2 concepts.
The first one is encapsulating a set of related methods properties into a single unit so that it can be exposed as a single instance to the external world. In C# this is implemented using the concept of classes. A class allows us to group a set of related variables and methods into a single unit and they can be accessed by creating a single instance of the class.
The second one is data hiding, i.e showing only the required details to the external world and hiding the other details which are not required to be exposed. Again this is implemented using classes and a set of access modifiers.
The first one is encapsulating a set of related methods properties into a single unit so that it can be exposed as a single instance to the external world. In C# this is implemented using the concept of classes. A class allows us to group a set of related variables and methods into a single unit and they can be accessed by creating a single instance of the class.
The second one is data hiding, i.e showing only the required details to the external world and hiding the other details which are not required to be exposed. Again this is implemented using classes and a set of access modifiers.

