当前位置:网站首页>2. What is the difference between Exception and Error?
2. What is the difference between Exception and Error?
2022-08-03 06:22:00 【The yu classmate】
1. Exception: Some exceptions that may occur during the running of the program are required to be handled or captured by the program.It is because of the design of the program or some input and so on.
Exception is a kind of exception that may occur during java runtime, divided into runtime (unchecked exception) exception and non-runtime exception (checked exception).
1. Runtime exceptions: such as array access subscript out of bounds, null pointer exception, number conversion exception and so on.
Usually programs do not force us to catch such exceptions, but we are encouraged to do so.
2. Non-operation is abnormal: file does not exist, IO exception, etc.
Force we must handle this type of exception: catch it with a try-catch block in the current class, or throw an exception with throws.
The exception is only possible, it does not mean that it must appear, but for this possibility, we will deal with the possibility of this exception in advance.
Second, Error: A system-level error that the program does not have to deal with.For example, insufficient memory space, hardware problems, etc.For this kind of error, the program is basically powerless, and has no choice but to exit the program, which is usually thrown by the java virtual machine.
边栏推荐
- 使用ZBrush制作恶魔模型
- Practice of MySql's Sql statement (try how many you can write)
- 树——二叉排序树(BST)
- 关于芯片你了解吗?
- ucos任务调度原理
- Difference between @JsonProperty and JSONField?
- VS2022 encapsulates static libraries and calls static libraries under window
- ZEMAX | 如何使用ZOS-API创建自定义操作数
- classpath: comparison with classpath*
- 3d建模师为什么不建议入行
猜你喜欢
随机推荐
ucos任务调度原理
ZEMAX | 在设计抬头显示器(HUD)时需要使用哪些工具?
How the world's leading medical technology company maximizes design productivity | SOLIDWORKS Product Exploration
ZEMAX | 如何使用渐晕系数
使用ZBrush制作恶魔模型
MySql的Sql语句的练习(试试你能写出来几道呢)
【C语言】斐波那契数列
设备树解析源码分析<devicetree>-1.基础结构
Delightful Nuxt3 Tutorial (2): Build a Blog Quickly and Easily
ZEMAX | 探究 OpticStudio 偏振分析功能
Practice of MySql's Sql statement (try how many you can write)
ue4入门学习笔记1(操作界面)
浮点型数据在内存中存储的表示
使用Blender和ZBrush制作武器模型
A.1#【内存管理】——1.1.3 page: struct page
借助ginput函数在figure窗口实时读取、展示多条曲线的坐标值
电子元器件之电子变压器可分为哪几类?
Difference between @JsonProperty and JSONField?
Automatic ticket issuance based on direct reduction of China Southern Airlines app
虚拟地址空间布局









