相反,您应该对此类条件使用未经检查的异常,以便能够可选地处理这些条件。
Instead, you should use unchecked exceptions for such conditions, so that you can optionally handle these conditions.
例如,如果股票交易系统遇到问题,则该服务可能因某种未经检查的异常而无法获得报价。
For example, if the stock exchange system runs into a problem, the service might fail to obtain the quote with some kind of unchecked exceptions.
测试失败通过抛出未经检查的异常来指示,通常使用JUnit提供的断言和故障方法指示。
Test failures are indicated by throwing unchecked exceptions, typically by using JUnit-provided assertion and failure methods.
应用推荐