Eclipse警告未知的错误 [英] Eclipse warn about uncaught Error

查看:161
本文介绍了Eclipse警告未知的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当未能捕获 Exception 的子类时,Eclipse将发出编译警告(红色)。

When failing to catch a subclass of Exception, Eclipse will issue a compilation warning (red).

但是,当错误的子类未被捕获时,不会发出警告,容易忘记,包括 throws SomethingError 语句

However, when an subclass of Error is uncaught, no warning is issued, making it easy to forget including the throws SomethingError statement.

推荐答案

这是检查(Exception的子类除外RuntimeException)和未检查的异常(RuntimeException或Error的子类)之间的区别。

This is the difference between checked (subclasses of Exception excluding RuntimeException) and unchecked exceptions (subclasses of RuntimeException or Error).

  • Oracle note on the subject
  • Stackoverflow: Java: checked vs unchecked exception explaination

这篇关于Eclipse警告未知的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆