There have been several efforts to make Design by Contract available in Java. Most of the efforts involve using Javadoc comments to specify the contracts. Preconditions are conditions that the client of the class needs to satisfy in order for the class to work properly. They outline the restrictions on arguments and specify what values the arguments can't take. Postconditions are conditions that the implementor or supplier of the class will always fulfill as long as the client has fulfilled the preconditions.
Class invariants are conditions that are guaranteed always to be true.
Postconditions also specify what the return values should be. Note that the concept of Design by Contract is similar to assertions, but quite a bit more sophisticated and useful. Design concepts are placed directly in the code itself. Second, the code's contracts can be checked for consistency because they are explicit. Third, the class implementation can assume that input arguments satisfy the preconditions, so the implementation can be simpler and more efficient.