Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Hitung {
- public double hitungSalary(Employee e) {
- return e.salary;
- }
- //Polymorphic Arguments : TestPolyArg.java
- public class TestPolyArg {
- public static void main(String[ ] args) {
- Employee p1 = new Employee();
- Manager p2 = new Manager();
- Hitung p3 = new Hitung();
- System.out.println("Salary p1 : " + p3.hitungSalary(p1));
- System.out.println("Salary p2 : " + p3.hitungSalary(p2));
- }
Advertisement
Add Comment
Please, Sign In to add comment