- It is the fundamental principle concept of oops.
- It hides the data from outside the world.
- You can also say that it is the process of hiding internal data from outside the world.
- It gives maintainability, flexibility and extensibility to our code.
- It gives the ability to hide the data and method fro m out side the world and only expose data and method that are required.
- it also hide the information from the object.
Class Employee
{
private int _employeeId;
private double _salary;
public int SetEmployeeId(int EmpId)
{
_employeeId=EmpId;
}
public int GetEmployeeId()
{
return _employeeId;
}
public double SetEmployeeSalary(double Salary)
{
_salary=Salary;
}
public int GetEmployeeSalary()
{
return _salary;
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.