【定义】

error: external, like out of memory

exception: internal, like file not found

父类都是throwable 逻辑有错是runtimeerror

【是否check】

unchecked types: error, run time exception

how to solve checked: catch, specify

【处理方法】

Scanner input = new  Scanner(new File(filename)); 必须要有

file not found exception

【exception处理情景】

顺序:从特殊到一般,最特殊的是3,先处理3

【Custom exceptions 自定义异常】

可能会抛出或捕获运行时异常,但编译器不会检查它们

从try-block抛出异常时,它可以被任何catch块捕获和处理
从catch块中抛出异常时,它不能被同一级别的其他catch块捕获。 在catch-block中创建一个嵌套的try-catch块,以在内部catch块中处理它。

自定义的Exception要加new

throw new MyException()

Exceptions的更多相关文章

  1. "NHibernate.Exceptions.GenericADOException: could not load an entity" 解决方案

     今天,测试一个项目的时候,抛出了这个莫名其妙的异常,然后就开始了一天的调试之旅... 花了很长时间,没有从代码找出任何问题... 那么到底哪里出问题呢? 根据下面那段长长的错误日志: -- ::, ...

  2. 2000条你应知的WPF小姿势 基础篇<34-39 Unhandled Exceptions和Resource>

    在正文开始之前需要介绍一个人:Sean Sexton. 来自明尼苏达双城的软件工程师.最为出色的是他维护了两个博客:2,000Things You Should Know About C# 和 2,0 ...

  3. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'dd' in 'where clause'

    今天在使用mysql数据库查找数据的时候报错,错误信息如下: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown co ...

  4. MIT 6.828 JOS学习笔记18. Lab 3.2 Part B: Page Faults, Breakpoints Exceptions, and System Calls

    现在你的操作系统内核已经具备一定的异常处理能力了,在这部分实验中,我们将会进一步完善它,使它能够处理不同类型的中断/异常. Handling Page Fault 缺页中断是一个非常重要的中断,因为我 ...

  5. Solve VS2010 Error "Exceptions has been thrown by the target of an invocation"

    Sometimes when you open a VS2010 project, an error window will pop up with the error message "E ...

  6. MyBatis-Exception:org.apache.ibatis.exceptions.PersistenceException

    错误信息如下: HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache. ...

  7. App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file

    ios进行http请求,会出现这个问题: App Transport Security has blocked a cleartext HTTP (http://) resource load sin ...

  8. 添加 All Exceptions 断点后, 每次运行都会在 main.m 中断的一种解决方法

    在本人项目添加导入和使用新的字体过程中,遇到一个很奇怪的问题: 项目开启了全局断点,但是每次启动都会运行在mian.m中断,点击下一步程序继续正常运行. 不知道是什么原因,于是google百度寻找答案 ...

  9. python基于Django框架编译报错“django.core.exceptions.ImproperlyConfigured”的解决办法?

    下面是我具体遇到的问题和解决方法: 错误详细信息: django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_IND ...

  10. Rethrowing exceptions and preserving the full call stack trace

    refer:http://weblogs.asp.net/fmarguerie/archive/2008/01/02/rethrowing-exceptions-and-preserving-the- ...

随机推荐

  1. UI5-Fiori初学者导航

    正文 你是UI5和Fiori的新手?来对地方了. 对我来说,今年是不得不“跟上时代”去提升自己ABAP世界以外的技术技能的困难的一年.幸运的是,有很多可免费获得的信息和课程可以帮你实现这个跳跃.不要等 ...

  2. svn从本地更新了资源库的资源后删除了某个文件夹无法恢复(已解决)

    事件描述: 删除了本地svn的某个文件夹中的某个文件后,想要恢复,但是无法恢复,解决方法如下 步骤: 1:在删除的文件夹下右键,选择TortoiseSVN——>Revert... 2:选择需要恢 ...

  3. Mac下如何安装WebStorm + 破解

    1.官网下载       下载地址   选择好系统版本以后,点击DOWNLOAD        2.安装 双击下载好的安装包.将WebStromt拖入application文件夹,然后在Launchp ...

  4. python实现Excel删除特定行、拷贝指定行操作

    工作中遇到的,本来用VBA写的,操作很慢,尝试用Python实现, 任务需求: 从原始的两张表中拷贝行到五张表中,如下表所示: source1和source2是一样的格式:         one t ...

  5. WEB前端问题——img标签的onclick事件无法响应问题【转载】

    一个纠结了一下午的问题,img标签里面的onclick事件无法响应.最终找到了错误原因,是因为img标签的id与onclick事件的方法名相同. 于是接着又测试了一下,发现name名和方法名相同也会导 ...

  6. python遇到的文件错误

    学习了json.load,运行时出现了以下错误 load读取的是前面写入的文件,如果读取的文件为空,则会出现这个错误,如果不为空,则正确.所以一定要保证读取的文件不为空.

  7. PLM修改数据库密码

    在WINDCHILL SHELL中执行以下命令: xconfmanager -s wt.pom.dbPassword=数据库密码 -t db/db.properties -p 重启服务

  8. python 常用模块(一): random , time , sys , os模块部分知识.

    1.常用模块:(1)collectiaons模块 (2)与时间相关  time模块 (3)random模块 (4)os模块 (5)sys模块 (6) 序列化模块: json  ,   pickle 2 ...

  9. SSM的例子-参考

    ssm的例子:http://blog.csdn.net/double030/article/details/63683613

  10. sqlserver 事务嵌套

    参考 https://www.cnblogs.com/JentleWang/p/3654603.html https://blog.csdn.net/tuzhen007/article/details ...