Section 11.11 Assertions

• Assertions (p. 465) help catch potential bugs and identify possible logic errors.

• The assert statement (p. 466) allows for validating assertions programmatically.

• To enable assertions at runtime, use the -ea switch when running the java command.

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.