December 16, 2009

Assertions in Java

Turn on assertions with the -ea or -enableassertions command line flag

In Eclipse, right-click on the file to run in Package Explorer, hover on "Run As" (or "Debug As") and select "Run Configurations..." (or "Debug Configurations..."). Then, select the "Arguments" tab and add the flag in the "VM arguments" box.

Discussion of assertions in production code from Dr. Dobbs

No comments:

Post a Comment