处理Java中的运行时异常 [英] Handling RuntimeExceptions in Java
本文介绍了处理Java中的运行时异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以解释如何处理Java中的运行时异常?
Can anyone explain how to handle the Runtime Exceptions in Java?
推荐答案
与处理常规异常没有什么区别:
It doesn't differ from handling a regular exception:
try {
someMethodThatThrowsRuntimeException();
} catch (RuntimeException ex) {
// do something with the runtime exception
}
这篇关于处理Java中的运行时异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文