SE450
:
Postconditions, Visibility, Exceptions
[16/65]
Postcondition of redefined method
at least as strong
Example:
Employee.setSalary
promises not to decrease salary
Then
Manager.setSalary
must fulfill postcondition
Redefined method cannot be more
private
.
(Common error: omit
public
when redefining)
Redefined method cannot throw more checked exceptions