Definition: In Object Oriented Programming, encapsulation is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it restricted to members of that class.
- Public : All Objects can access it.
- Protected : Access is limited to members of the same class or descendants.
- Private : Access is limited to members of the same class.
- Internal : Access is limited to the current assembly.
- Protected Internal : Access is limited to the current assembly or types derived from the containing class.
Glossary:A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Examples:For the best encapsulation, object data should almost always be restricted to private or protected.