7_第七篇异常.pptVIP

  • 0
  • 0
  • 约4.9千字
  • 约 19页
  • 2017-06-20 发布于湖北
  • 举报
* * ● 异常的概念 ● 异常的分类 ● 异常的处理 throws、throw、捕获 第七章 异常 ● 异常的概念 ● 异常实际上是错误出现导致中断正常的程序执行的一种事件 ● Java采用异常处理的错误捕获机制来处理 例:ExceptionExample.java ● 异常的概念 不处理错误: 读取文件的代码 open the File; determine its size; allocate that much memory; read the file into memory; close the file; ● 异常的概念 以传统方法处理错误: open the file; if (the file is open) { determine the length of the file; if (The file length is got){ allocate enough memory; if (The memory is allocated) { read the file into memory; if(read file success){ close the f

文档评论(0)

1亿VIP精品文档

相关文档