Java学习笔记 第四章 异常

JAVA学习笔记第四章

4.异常

异常:Exception程序运行的时候出现不正常的现象,阻止程序的运行

image-20210518134919341

很难堵住所有的漏洞

4.1try-catch

image-20210518135014109

image-20210518135103316

image-20210518135154297

image-20210518135322100

image-20210518135638878

image-20210518135915372

4.2finally

image-20210518140226975

image-20210518140200932

image-20210518140310616

4.3

image-20210518140407432

4.3多重catch

image-20210518140620724

image-20210518140500944

4.4异常层次分类

image-20210518141205913

image-20210518140845465

检查异常:

image-20210518141400295

image-20210518141426270

image-20210518141455142

4.5throw和throws

image-20210518141844217

image-20210518141907239

image-20210518142041439

4.6重载和重写异常

image-20210518142451659

image-20210518142606432

4.7自定义异常

image-20210518143003195

image-20210518143024011

![image-20210518143044316](../Library/Application Support/typora-user-images/image-20210518143044316.png)

原文地址:https://www.cnblogs.com/wrrr/p/14789278.html