Programming Principles - Encapsulation

Posted on at


Encapsulation is a technique used by programmers to link the process and the attributes associated with it.

for example:

sum = a + b;

where sum is the object of encapsulation,

           a , b, and + sign as attributes,
and a + b as the process itself.

 

Encapsulation occurs in many ways. Another example is in java,

Public Class Example {

wherein the CLASS Example is the object of encapsulation and all other codes inside its delimiters are processes and attributes.



About the author

160