Encapsulation is the packing of data and functions into a single component. The features of encapsulation are supported using classes. It allows selective hiding of properties and methods in a class by building an impenetrable wall to protect the code from accidental corruption.
Simple Example is private Variables.
using System;
namespace RectangleApplication
{
class Rectangle
{
private double length;
private double width;
.....
For More information[
^]