Function contracts allow the programer to check for inconsistencies. Inconsistencies include invalid parameters, checks for the correct return value or an invalid state of the object.
The checks can happen before and after the body of the function or method is executed.
void printNotGreaterThan42(...