异常恢复模型
来源:互联网 发布:android studio mac 编辑:程序博客网 时间:2024/05/16 02:33
终止与恢复
在Java异常中 有两种机制
一种是终止模型 一种是恢复模型
用while循环建立 恢复模型 不断重复 直到不再出现异常
public class Ex5 {private static int[] ia = new int[2];static int x = 5;public static void main(String[] args) {while(true) {try {ia[x] = 1;System.out.println(ia[x]);break;} catch(ArrayIndexOutOfBoundsException e) {System.err.println("Caught ArrayIndexOutOfBoundsException");e.printStackTrace();x--;} finally {System.out.println("Are we done yet?");}}System.out.println("Now, we're done.");}}
Caught ArrayIndexOutOfBoundsExceptionAre we done yet?Are we done yet?java.lang.ArrayIndexOutOfBoundsException: 5at my.test.Ex5.main(Ex5.java:9)Caught ArrayIndexOutOfBoundsExceptionjava.lang.ArrayIndexOutOfBoundsException: 4at my.test.Ex5.main(Ex5.java:9)Caught ArrayIndexOutOfBoundsExceptionjava.lang.ArrayIndexOutOfBoundsException: 3at my.test.Ex5.main(Ex5.java:9)Are we done yet?Caught ArrayIndexOutOfBoundsExceptionjava.lang.ArrayIndexOutOfBoundsException: 2at my.test.Ex5.main(Ex5.java:9)Are we done yet?1Are we done yet?Now, we're done.
- 异常恢复模型
- Tensorflow:模型保存/模型恢复?
- Tensorflow 部分恢复模型
- 数据库异常恢复办法
- Mysql数据异常恢复
- TensorFlow之保存/恢复模型
- Tensorflow:如何保存/恢复模型?
- java异常处理模型
- Java 异常模型综述
- 简单异常处理 且恢复
- HDFS异常恢复调研报告
- Visual C++ 异常模型【En】
- 有效的Java异常模型
- (异常)Hibernate的动态模型
- 异常行为分析模型设计
- 预测异常报警模型实践
- 异常行为分析模型设计
- Spark 线性回归模型异常
- jstat 详解
- 如何在Web上判断是否已经安装了某个ActiveX控件
- oracle 管理 之 数据恢复 之闪回
- 如何解决:Android中 Error generating final archive: Debug Certificate expired on 10/09/18 16:30 的错误
- XML学习之SAX解析XML文件
- 异常恢复模型
- Performance tips for Cocos2d for iPhone
- 趣味题 c语言
- Sound on iOS: Best Practices
- 最长重合区间问题
- Hadoop-0.20.0源代码分析(7)http://blog.csdn.net/shirdrn/article/details/4581666
- 系统架构--淘宝网--淘宝网采用什么技术架构来实现网站高负载的
- hdoj 1016 (dfs)
- android AlertDialog布局 ——2