Type A is a subtype of type B if A's specification implies B's specification. The subtype must have all the methods of the supertype, with compatible signatures. Java actually enforces even stricter rules about signature compatibility in subclasses. It allows a subclass to be declared to throw a subset of the exceptions or to throw subclasses of the exceptions thrown by the superclass, but otherwise subclass and superclass must have identical method signatures.
Methods rule .
A subtype's specification for any method must be at least as strong as its supertype's specification. So, a subtype method can weaken the precondition and can strengthen the postcondition. Properties rule . The subtype must preserve all properties that can be proved about the supertype. Invariants that are guaranteed in the supertype must also be guaranteed by the subtype.