.net 专家

住在上海

导航

java 异常的问题讨论

 Java提供了两类主要的异常:runtime exception和checked exception。所有的checked exception是从java.lang.Exception类衍生出来的,而runtime exception则是从java.lang.RuntimeException或java.lang.Error类衍生出来的。

转载 http://www.yesky.com/225/1842225.shtml

14、给我一个你最常见到的runtime exception
答:
常见的运行时异常有如下这些ArithmeticException,
 ArrayStoreException,
 BufferOverflowException,
 BufferUnderflowException,
 CannotRedoException, 
CannotUndoException, 
ClassCastException,
 CMMException,
 ConcurrentModificationException,
 DOMException,
 EmptyStackException,
 IllegalArgumentException,
 IllegalMonitorStateException,
 IllegalPathStateException,
 IllegalStateException,
 ImagingOpException, 
IndexOutOfBoundsException,
 MissingResourceException,
 NegativeArraySizeException,
 NoSuchElementException,
 NullPointerException,
 ProfileDataException, 
ProviderException,
 RasterFormatException,
 SecurityException,
 SystemException,
 UndeclaredThrowableException,
 UnmodifiableSetException,
 UnsupportedOperationException

15
errorexception有什么区别
答:error 表示恢复不是不可能但很困难的情况下的一种严重问题。比如说内存溢出。不可能指望程序能处理这样的情况
    exception 
表示一种设计或实现问题。也就是说,它表示如果程序运行正常,从不会发生的情况

http://www.cnitblog.com/gavntery/archive/2005/12/18/5551.aspx

posted on 2006-02-20 10:29  bobomail  阅读(933)  评论(19编辑  收藏  举报