MFA1513

Untitled

Jan 8th, 2017
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. public class Hitung {
  2.     public double hitungSalary(Employee e) {
  3.         return e.salary;
  4.     }
  5. //Polymorphic Arguments : TestPolyArg.java
  6.     public class TestPolyArg {
  7.         public static void main(String[ ] args) {
  8.             Employee p1 = new Employee();
  9.             Manager p2 = new Manager();
  10.             Hitung p3 = new Hitung();
  11.             System.out.println("Salary p1 : " + p3.hitungSalary(p1));
  12.             System.out.println("Salary p2 : " + p3.hitungSalary(p2));
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment