In this chapter, you will learn:
What an assertion is in Java
How to use assertions in Java programs
How to enable and disable assertions
How to check the status of an assertion
All classes in this chapter are members of a jdojo.assertion module, as declared in Listing 14-1.
Listing 14-1. The Declaration of a jdojo.assertion Module
// module-info.java
module jdojo.assertion {
exports com.jdojo.assertion;
}
What Is an Assertion?
The literal meaning of assertion is to state something in a strong, confident , and forceful way. When you assert “something,” you believe that “something” to ...