当前位置:网站首页>异常的处理:抓抛模型
异常的处理:抓抛模型
2022-04-23 05:42:00 【hanyc..】
过程一:“抛”:程序在正常执行过程当中,一旦出现异常,就会在异常代码处生成一个对应异常类的对象,并将此对象抛出。一旦抛出对象以后,其后的代码就不再执行了。
关于异常对象的产生:
①系统自动生成异常对象 ;
②手动生成一个异常对象,并抛出(throw)
过程二:“抓”:可以理解为异常的处理方式:
(1)try-catch-finally
(2)throws
throw:异常对象产生的一种方式,手动产生一个异常对象;(位于方法体内)
throws:处理异常的一种方式;(位于方法声明处)
版权声明
本文为[hanyc..]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_42732184/article/details/117967245
边栏推荐
- 第36期《AtCoder Beginner Contest 248 打比赛总结》
- The QT debug version runs normally and the release version runs crash
- Add days to date
- lambda表达式
- What is JSON? First acquaintance with JSON
- ‘EddiesObservations‘ object has no attribute ‘filled‘
- Parameter analysis of open3d material setting
- ES6之解构函数
- Character recognition easyocr
- MySQL的锁机制
猜你喜欢
Use of qwbengneview and qwebchannel.
Transposed convolution
Hongji cyclone RPA provides technical support for Guojin securities and realizes process automation in more than 200 business scenarios
JVM系列(4)——内存溢出(OOM)
Package mall system based on SSM
Ora: 28547 connection to server failed probable Oracle net admin error
AcWing 836. Merge set (merge set)
SQL statement simple optimization
Isosceles triangle - the 9th Lanqiao provincial competition - group C
OSI层常用协议
随机推荐
mysql实现主从复制/主从同步
Common status codes
提升Facebook触及率和互动率攻略 | 智能客服帮您抓住用户的心
引航成长·匠心赋能——YonMaster开发者培训领航计划全面开启
refused connection
Step on the pit: Nacos uses startup CMD - M standalone startup error
excel获取两列数据的差异数据
Deconstruction function of ES6
MySQL transaction
类的加载与ClassLoader的理解
refused connection
io. lettuce. core. RedisCommandExecutionException: ERR wrong number of arguments for ‘auth‘ command
Map对象 map.get(key)
solidity合约DOS攻击
Total score of [Huawei machine test] (how to deal with the wrong answer? Go back once to represent one wrong answer)
mysql-触发器、存储过程、存储函数
50 SQL exercises, answers and detailed analysis
Differences between sea level anatomy and sea surface height anatomy
The difference between cookie and session
创建线程的三种方式