Encapsulation (computer programming): Difference between revisions

Content deleted Content added
Line 42:
// but it cannot manipulate the value of "accountBalance"
}
}
}
</source>
 
Below is an example in Java programming language:
<source lang="java">
 
public class Employee
{
private float salary = 50000.00;
public float getSalary()
{
return salary;
}
 
public static void main()
{
Employee e = new Employee();
float sal = e.getSalary();
}
}