The Source for Java Technology Collaboration


Home | Help | Changes | Index | Search | Go

Assertions

Assertions allow a programmer to test their assumptions about a program's behaviour. For example, ensure that the result of some calculation is always greater than zero. Before J2SE 1.4, a programmer had to write their own assertion mechanism such as coding a utility class method. J2SE 1.4 added the assert keyword. Read Programming With Assertions for an introduction to using assert. If you already use or plan to use assertions, you may also want to read about the Assertions Are Free Misconception.

The assertions facility was introduced to Java via JSR-41 A Simple Assertion Facility.

Articles



Discussion about Assertions

Topic Assertions . { Edit | Ref-By | Printable | Diffs r1 | More }
 XML java.net RSS

Revision r1 - 01 Nov 2003 - 20:02:00 - Main.redwolf