previous | start | next

## Preconditions

- Precondition of redefined method at most as strong

-     public class Employee
      {
         /**
            Sets the employee salary to a given value.
            @param aSalary the new salary
            @precondition aSalary > 0
         */
         public void setSalary(double aSalary) { ... }
      }

- Can we redefine `Manager.setSalary` with precondition
  `salary > 100000`?
- No--Could be defeated:

      Manager m = new Manager();
      Employee e = m;
      e.setSalary(50000);

previous | start | next