Advertisement
glee20

Encapsulation Test

Dec 11th, 2018
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. public class EncapsulationTest {
  2.     public static void main (String args []) {
  3.         Encapsulation a = new Encapsulation();
  4.         a.name = "Amy";
  5.         a.workhour = 10;
  6.         a.payment = 8;
  7.         a.incomeTax();
  8.         a.pensionContribution();
  9.         a.healthInsurance();
  10.         a.totalSalary();
  11.         a.display();
  12.         System.out.println("");
  13.        
  14.         Encapsulation b = new Encapsulation();
  15.         b.name = "Brian";
  16.         b.workhour = 9;
  17.         b.payment = 12;
  18.         b.incomeTax();
  19.         b.pensionContribution();
  20.         b.healthInsurance();
  21.         b.totalSalary();
  22.         b.display();
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement