【定义】

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. 人脸识别68个点<转>

    [Opencv] 于仕琪 人脸68个特征点分布情况 // 鼻尖 30 // 鼻根 27 // 下巴 8 // 左眼外角 36 // 左眼内角 39 // 右眼外角 45 // 右眼内角 42 // 嘴 ...

  2. oracle中去掉回车换行空格的方法详解

    函数: 1.translate语法:TRANSLATE(char, from, to)用法:返回将出现在from中的每个字符替换为to中的相应字符以后的字符串.            若from比to ...

  3. centos7,进程最大打开文件数 too many open files错误

    遇到一问题,tomcat最近发生几次异常,查看日志,发现一直报 too many open files,熟悉的同学都知道这是用户打开文件数过多导致的, 再用命令ls /proc/20861/fd/ | ...

  4. oracle归档日志关闭和打开

    查询归档日志状态 方法一 SQL> archive log list; 方法二 SQL> select name,log_mode from V$database; 打开归档日志 orac ...

  5. shell编程小技巧(命令篇)

    本文主要介绍shell编程中一些好用的命令或者一些常见命令但比较少用却又好用的参数,目的是希望可以提高编码效率. df命令 常用命令 df / df -k / df -m / df -H / df - ...

  6. 四则运算之Right-BICEP单元测试

    一. 这篇博客要对上次实现的四则运算进行单元测试,一是检查上次的程序的实现情况,二是巩固单元测试的相关知识.本次进行单元测试用的是Riget-BICEP方法. Riget-BICEP方法: 1.Rig ...

  7. C#调用C++

    c++ extern "C" __declspec(dllexport) char* WINAPI base64_decode( char *data,char base[]) { ...

  8. Structs复习 访问web元素

    Structs帮我们在action和http里建立了联系 主要有四种方式 我们主要用第二种(IOC 依赖容器注入 ) Jar包 web.XML <?xml version="1.0&q ...

  9. idea gradle卡主问题

    http://services.gradle.org/distributions/  首先下载 all 版本 ,解压 ,再d盘, 并保留zip 文件  ,新建环境变量 GRADLE_HOME   指向 ...

  10. linux 基本操作centos7

    基于centos7  ,很多都跟6不同 Centos 7 firewall 命令: 查看已经开放的端口:firewall-cmd --list-ports 开启端口firewall-cmd --zon ...