Java

Exception, RuntimeException

휘사마 2011. 11. 26. 20:27
RuntimeException 을 상속받아 만든 클래스 ( 혹은 그 자신) 은 

의무적으로 catch 하지 않아도 된다.

(C#도 저거랑 똑같은 이름으로 있는듯?)

http://download.oracle.com/javase/1.4.2/docs/api/java/lang/RuntimeException.html

public class RuntimeException
extends Exception
RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine.
A method is not required to declare in its throws clause any subclasses of RuntimeException that might be thrown during the execution of the method but not caught.