正在加载图片...
异常处理 try, catch和fnll语句 ∥此处为抛出具体异常的代码 catch(ExceptionTypel e)( ∥抛出 Exception Type异常时要执行的代码 I catch(Exception Type2 e) ∥抛出 Exception Type2异常时要执行的代码 I catch(Exception Typek e)( ∥抛出 Exception Typek异常时要执行的代码 I finally i ∥必须执行的代码 例6-3异常处理 ▪ try,catch和finally语句 ▪ 例6-3 try { // 此处为抛出具体异常的代码 } catch (ExceptionType1 e) { // 抛出ExceptionType1异常时要执行的代码 } catch (ExceptionType2 e) { // 抛出ExceptionType2异常时要执行的代码 ... } catch (ExceptionTypek e) { // 抛出ExceptionTypek异常时要执行的代码 }finally { // 必须执行的代码 }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有