java中的异常是什么? [英] What is an exception in java?

查看:96
本文介绍了java中的异常是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Java中的异常,我有几个问题:

I havea few questions regarding exceptions in java:


  1. 什么是Java异常?

  1. What is java exception?

异常是否被视为错误?

何时应该抛出异常?

有多少种例外?


推荐答案


  1. 一个信号,表明代码中出现了某些故障,但是可以通过编程方式恢复。

  1. A signal that something failed in the code, but which is programmatically recoverable.

取决于您如何解释错误。这是模棱两可的。

Depends on how you interprets "error". This is ambiguous.

当您想表明代码中有某些错误但可以通过编程方式恢复时。

When you want to signal that something failed in the code, but which is programmatically recoverable.

不计其数。您也可以创建自定义变量。

Countless. You can namely also create custom ones.

要了解有关异常的更多信息,请检查关于该主题的Sun教程

To learn more about exceptions, check the Sun tutorial on the subject.

这篇关于java中的异常是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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