Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EncapsulationTest {
- public static void main (String args []) {
- Encapsulation a = new Encapsulation();
- a.name = "Amy";
- a.workhour = 10;
- a.payment = 8;
- a.incomeTax();
- a.pensionContribution();
- a.healthInsurance();
- a.totalSalary();
- a.display();
- System.out.println("");
- Encapsulation b = new Encapsulation();
- b.name = "Brian";
- b.workhour = 9;
- b.payment = 12;
- b.incomeTax();
- b.pensionContribution();
- b.healthInsurance();
- b.totalSalary();
- b.display();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement