Assertions give you a way to test your assumptions during development and debugging. : assert « Statements « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Statements » assert 
5.13.1.Assertions give you a way to test your assumptions during development and debugging.
Assertions are typically enabled during testing but disabled during deployment.

Assertions are disabled at runtime by default
To enable them, use a command-line flag -ea or -enableassertions.

Selectively disable assertions by using the -da or -disableassertions flag.

You can enable and disable assertions on a class-by-class basis, using the following syntax:

java -ea -da:MyClass TestClass
5.13.assert
5.13.1.Assertions give you a way to test your assumptions during development and debugging.
5.13.2.The new assert keyword has the following syntax
5.13.3.Assertion Command-Line Switches
5.13.4.Do Use Assertions to Validate Arguments to a Private Method
5.13.5.Use Assertions to Check for unreachable code
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.