Encapsulation refers to the creation
of self-contained modules that bind
processing functions to the data.
These user-defined data types are
called "classes," and one instance of a
class is an "object “.
Encapsulation is a process of
binding or wrapping the data and the
codes that operates on the data into a
single entity. This keeps the data safe
from outside interface and misuse. One
way to think about encapsulation is as a
protective wrapper that prevents code
and data from being arbitrarily accessed
by other code defined outside the
Improves the Understandability
of the Application.
Maintenance of Application
Encapsulation is most often achieve
through information hiding , which is the
process of hiding all the secret of an
object that do not contribute to its
essential characteristics,the structure of
an object hidden, as well as the
implementation of its method. Only the
essential characteristics of object are
cout<<“enter the ccode and cname”;
college c1; // object declaration
c1.read(); // function calling
To allow one class ("server") to
make a contract with another
Data and Function may be public or
It hides the complexity from the
It also provide inter independencies.
Abstraction focuses upon the
observable behavior of on object
Encapsulation focuses upon
implementation that gives rise to
Through encapsulation , an interface is
made available to world through which
users can use the class .
It is the one of the important
feature of oop. It is used to wrap
the data and function together in
a single unit. Thus, it also
provide inter independencies.