当前位置:网站首页>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.
边栏推荐
猜你喜欢

SQLMAP介绍及使用

ZEMAX | 如何围绕空间中的任何点旋转任何元素

cb板上常用的电子元器件都有哪些?

JSP的基本使用

自监督论文阅读笔记 Self-supervised Label Augmentation via Input Transformations

window下VS2022封装静态库以及调用静态库

电容器和电池有什么不同?

自监督论文阅读笔记DisCo: Remedy Self-supervised Learning on Lightweight Models with Distilled Contrastive

2-php学习笔记之控制语句,函数

【第三周】ResNet+ResNeXt
随机推荐
借助ginput函数在figure窗口实时读取、展示多条曲线的坐标值
在Maya和ZBrush中制作战士模型
ZEMAX | 在 OpticStudio 中使用自由曲面进行设计
数组与字符串9-翻转字符串里的单词
【第一周】深度学习和pytorch基础
cmdline -[command line,__fdt_pointer,initial_boot_params] boot_command_line 获取
ZEMAX | 如何使用渐晕系数
自监督论文阅读笔记 Self-supervised Learning in Remote Sensing: A Review
二分查找1-实现一个二分查找
ucosII OSMemCreate()函数的解析
MCU接收串口字符型数据转换成数据型数据
3d建模师为什么不建议入行
常见的电子元器件分类介绍-唯样商城
最优化方法概述
什么是参数化设计,通过实操了解一下? | SOLIDWORKS 操作视频
ZEMAX | 如何倾斜和偏心序列光学元件
ARMv8 架构----armv8 类别
【第二周】卷积神经网络
A.1#【内存管理】——1.1.3 page: struct page
2021-04-30