Now, run the program with assertion checking enabled.
现在,请带有启用断言检查运行该程序。
Because assertion checking is disabled by default no assertion error is detected.
由于在缺省情况下禁用了断言检查,因此不会检测到任何断言错误。
Running the program with assertion checking enabled produces the following error report
带启用断言检查运行程序产生下面的错误报告
Use the -enableassertions option, or the shorter -ea option, to enable assertion checking.
请使用-enableassertions选项或更短的- ea选项来启用断言检查。
Assertion checking is disabled by default, so you'll also have to explicitly enable this facility at run time.
缺省情况下,会禁用断言检查,因此在运行时您也要显式地启用这一功能。
Assertion checking is like exception handling, but no exception is thrown when an assertion fails. Instead, an.
断言检查就象异常处理,但是当断言失败时,却不会抛出异常,而会抛出一个。
Assertion checking is like exception handling, but no exception is thrown when an assertion fails. Instead, an AssertionError is thrown.
断言检查就象异常处理,但是当断言失败时,却不会抛出异常,而会抛出一个AssertionError。
Fails the assertion without checking any conditions.
在不检查任何条件的情况下使断言失败。
Fails the assertion without checking any conditions.
在不检查任何条件的情况下使断言失败。
应用推荐