try { /* code that could throw an exception */ } catch (Exception ex) { /* handle the exception */ }
请注意,使用同一代码处理所有异常通常不是最佳方法。作为最后的手段,当任何内部异常处理例程失败时,通常使用此方法。