当前位置:网站首页>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.
边栏推荐
猜你喜欢
自监督论文阅读笔记FIAD net: a Fast SAR ship detection network based on feature integration attention and self
A.1#【内存管理】——1.1.3 page: struct page
数组与字符串10-实现 strStr()
增强光学系统设计 | Zemax 全新 22.2 版本产品现已发布!
使用Blender和ZBrush制作武器模型
What is parametric design, let's understand it through practical operation?| SOLIDWORKS How-To Videos
Typora
ue4学习日记4(植被,光照,光束遮挡,天空球)
数组与字符串11-反转字符串
pandoc -crossref插件实现markdwon文档转word后公式编号自定义
随机推荐
MySql的Sql语句的练习(试试你能写出来几道呢)
001_旭日X3派初探:开箱测试
自监督论文阅读笔记 Self-supervised Label Augmentation via Input Transformations
servlet学习(七)ServletContext
POE交换机全方位解读(中)
【第三周】ResNet+ResNeXt
【第四周】MobileNet和HybridSN
pandoc -crossref插件实现markdwon文档转word后公式编号自定义
自监督论文阅读笔记 Multi-motion and Appearance Self-Supervised Moving Object Detection
各种cms getshell技巧
三、final、finally、 finalize有什么不同?
ZEMAX | 探究 OpticStudio 偏振分析功能
VSCODE 常见问题
【第二周】卷积神经网络
建立平衡二叉树简单demo
借助ginput函数在figure窗口实时读取、展示多条曲线的坐标值
2021-03-22
MMU 介绍-[TBL/page table work]
page fault-页异常流程
What is parametric design, let's understand it through practical operation?| SOLIDWORKS How-To Videos