Encapsulation the ability of an object to hide its data and methods from the rest of the world. It is one of the fundamental principles of Oops.
The protection involves providing a stable interface which protects the remainder of the program from the implementation (the details that are most likely to change).
Public class Add
{
private void subtract(int x, int y)
{
return x * y;
}
}
…
…
Add obj;
int Result;
Result = obj.subtract(5,10);

