What is Encapsulation in C++ ?
Encapsulation :- It is amechanism that associates the code and the data. It manipulates into a single unit(class) and keeps then safe from external encapsulation is supported by a construct called class.
Example :- class student
{
private:
char * name;
public :
void getdata ();
void showdata ();
};
Data and methods are encapsulated in class.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment