Inheritance also relevant for types
…
Employee e; Sales s;
e = new Employee();
s = new Sales();
System.out.println(e.calculatePay());
System.out.println(s.calculatePay());
e = s;
System.out.println(e.calculatePay());
…
Which methods would be run?
Previous slide
Back to first slide
View graphic version