当前位置:网站首页>异常的处理:抓抛模型
异常的处理:抓抛模型
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
边栏推荐
- MySQL create Oracle exercise table
- No.1.#_ 6 Navicat shortcuts
- Map object map get(key)
- 转置卷积(Transposed Convolution)
- Common interview questions - 4 (MySQL)
- The role of brackets' [] 'in the parameter writing method in MDN documents
- Linear sieve method (prime sieve)
- idea插件---背景播放歌曲
- Idea plug-in --- playing songs in the background
- Use of qwbengneview and qwebchannel.
猜你喜欢

lambda表达式

Hongji | how does HR carry out self change and organizational change in the digital era?

SQL语句简单优化

Use of qwbengneview and qwebchannel.

框架解析1.系统架构简介

Package mall system based on SSM

2-软件设计原则

Isosceles triangle - the 9th Lanqiao provincial competition - group C

opensips(1)——安装opensips详细流程

Flutter nouvelle génération de rendu graphique Impeller
随机推荐
Breadth first search topics (BFS)
字符识别easyocr
[machine learning] scikit learn introduction
Date增加天数
JDBC操作事务
MySQL transaction
opensips(1)——安装opensips详细流程
基于ssm 包包商城系统
JVM系列(4)——内存溢出(OOM)
io. lettuce. core. RedisCommandExecutionException: ERR wrong number of arguments for ‘auth‘ command
Ora: 28547 connection to server failed probable Oracle net admin error
Redis经典面试题总结2022
2-软件设计原则
Meta annotation (annotation of annotation)
JVM系列(3)——内存分配与回收策略
Establish excel bookkeeping book through setting context menu
Flutter 新一代圖形渲染器 Impeller
Differences between sea level anatomy and sea surface height anatomy
Data mining -- understanding data
Excel obtains the difference data of two columns of data