Hi,
I am not good in Exception handLing, but here is my answer. Correct me if I am wrong.
NullPointerException is thrown because e is null. Here e is not ONLY checked exception. It can be any one its subclasses. Take a look at the code, it will throw InterruptedException.
Exception
|
|---------------------------|
Interrupted Run IO
|
|---------------|
Arith Null
When you throw an exception, and if there is no handler then it is the exception is handled by default handler.The default handler prints the name of the exception and the stack trace.
public class checkExcept
{
public static void main(String args[]) throws Exception {
InterruptedException e = new InterruptedException();
//null;
System.out.println(e);
throw e;
}
}
Vanitha.
[This message has been edited by Vanitha Sugumaran (edited July 08, 2001).]
[This message has been edited by Vanitha Sugumaran (edited July 08, 2001).]
When I type the message I am having a good format of the exception class & subclasses and its subclasses, but when I post it the format is not the same.
[This message has been edited by Vanitha Sugumaran (edited July 08, 2001).]