- 3
- 0
- 约 52页
- 2016-11-29 发布于重庆
- 举报
07JAVA编程基础7
异常流程由try ... catch ... finally语句来控制。 如果程序中还包含return和System.exit()句,就会使流程变得更加复杂— 2) return语句用于退出本方法.在执行try或catch代码块中的return语句时,假如有finally代码块,会先执行finally代码块。???? public class WithReturn{ public int methodA(int money)throws SpecialException{ if(--money=0) throw new SpecialException(Out of money); return money; } public int methodB(int money){ try{ System.out.println(Begin); int result=methodA(money); //可能抛出异常 return result; }catch(SpecialException e){ System.out.println(e.getMessage()); return -100; }finally{ System.out.println(
您可能关注的文档
最近下载
- 刘天琪电力系统分析理论第4章答案完整版.pdf VIP
- 劳动教育与劳动体验(中南财经政法大学)知到智慧树网课答案.docx VIP
- 2025年危险化学品生产经营单位其他从业人员(上海)模拟考试题及答案.pdf VIP
- 电力系统自动化技术专业人才培养方案.pdf VIP
- 海防建设规范(2025年版).docx
- 模拟电子技术基础简明教程(第4版)杨素行课后习题答案解析(1-6).pdf
- 2024数据中心高效散热的泵驱两相冷却技术.docx VIP
- 【哔哩哔哩-2025研报】十五大特色人群白皮书:洞见B站人群的年轻、好玩、有趣.pdf VIP
- JGJ-T231-2021建筑施工承插型盘扣式钢管脚手架.pdf VIP
- 排便护理实践指南(2025年版).docx VIP
原创力文档

文档评论(0)