dwj*_*ton 5 java testing error-handling runtime-error
我正在测试批处理脚本,以检查它是否在运行编译的jar时处理任何错误.
什么是我可以添加到我的java中导致运行时错误的最简单的代码片段?
ars*_*jii 10
你可以简单地扔一个RuntimeException:
throw new RuntimeException("Test runtime exception");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2988 次 |
| 最近记录: |