Topic: Java中“例外”是什么意思? |
Print this page |
1.Java中“例外”是什么意思? | Copy to clipboard |
Posted by: yxnk Posted on: 2004-04-03 10:49 请问各位大侠,Java中“例外”是什么意思,例外语句又起什么作用? |
2.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: leowu2000 Posted on: 2004-04-03 11:16 可以解释为"不可预知的情况" 或者初次接触 理解为"错误"也可. 我这么觉得. |
3.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: Starcraft Posted on: 2004-04-03 16:36 感觉翻译成例外真的很傻。 其实称之为异常还比较适合。 |
4.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: lcwling Posted on: 2004-04-03 19:39 不知道是不是Exception? |
5.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: junyuo Posted on: 2004-04-03 21:05 yxnk wrote: You can think it as an abnormal status that should not take place. Take the NumberFormatException for example. If one variable can only accept numeric value, it will throw NumberFormatException as the variable meets non-numeric value. |
6.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: javaxml1 Posted on: 2004-04-04 15:45 应该是Exception |
7.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: rostone Posted on: 2004-04-05 09:32 如果没有例外的话应该是异常(Exception) |
8.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: Wendy0007 Posted on: 2004-04-05 10:46 还不如说成例外^_^ |
9.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: chenxihua Posted on: 2004-04-05 12:33 异常 异常 |
10.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: song168 Posted on: 2004-04-09 16:56 我想是指错误或java异常类没有定义的错误 |
11.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: zhanglixy Posted on: 2004-04-17 20:52 我是这样理解的,在编写时你已经知道这可能会有问题了,但不知道是什么样的问题只知道在这个大类中,如只知道是SQL问题,具体运行起来,这类问题有很多,因为用户输入不同,问题就很多,所以得找个人看着,这就是例外. |
12.Re:Java中“例外”是什么意思? [Re: zhanglixy] | Copy to clipboard |
Posted by: Jove Posted on: 2004-04-17 21:09 设计应用系统异常的时候,应该用Runtime Exception还是Checked Exception真是个有争议的问题 为什么NumberFormatException是Runtime,为什么SQL Exception是Checked 难道因为一个不太容易发生,而另一个常会发生 你团队的代码是不是充斥着无谓的try/catch,又或者很放心的忽略那些runtime exception SpringFramwork有个特点便是很多模块只抛出RumtimeException, 还对既有的CheckedExceptoin做包装, 如HibernateException和SQLException,并通过继承树令这些异常更有意义 据说Gavin King也开始认同 Hibernate应该抛出RumtimeException. 关于这一点,Expert One-On-One J2EE Design and Development一书中也有讨论 |
13.Re:Java中“例外”是什么意思? [Re: yxnk] | Copy to clipboard |
Posted by: pengtaoli Posted on: 2004-04-21 20:42 就是异常,是可以捕捉到处理的。与错误(error)不同,错误一般都是直接推出来处理。而异常可以处理后,程序继续运行。 可参考try & catch & finally的用法。 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |