SE450
:
The Substitution Principle
[11/65]
Formulated by Barbara Liskov
You can use a subclass object whenever a superclass object is expected
Example:
Employee e;
...
System.out.println("salary=" + e.getSalary());
Can set
e
to
Manager
reference
Polymorphism: Correct
getSalary
method is invoked