Java catch block, caught exception is not final

前端 未结 4 1047
长发绾君心
长发绾君心 2021-02-04 07:05

I am checking out the new features of Java SE7 and I am currently at this point:

http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html

4条回答
  •  [愿得一人]
    2021-02-04 07:37

    The idea behind exception-based error handling is that each error should be recovered, if at all possible, at the appropriate level of abstraction. Such error recovery might require information that is not directly available where the exception is actually handled. For this reason it might be convenient to catch the exception, augment it with the relevant information and rethrow it or possibly set it as cause of a new exception object of a more appropriate class.

提交回复
热议问题