如何在Java异常处理中创建用户定义的函数

时间:2010-11-12 07:36:50

标签: java

如何在java异常处理中创建用户定义的函数

1 个答案:

答案 0 :(得分:1)

try {
  // some code that may raise an exception
} catch (SomeException e ) {
  // any code you like here, which may be a call to a method of any object
  MyHandler h = new MyHandler();
  h.handleIt(e);
}