Section 11.10 Preconditions and Postconditions

• A method’s precondition (p. 465) must be true when the method is invoked.

• A method’s postcondition (p. 465) is true after the method successfully returns.

• When designing your own methods, you should state the preconditions and postconditions in a comment before the method declaration.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.