Suppose you throw a checked exception out of the main method also... i mean you do want to handle it there. will the JVM handle it suppose it occurs there??
now suppose exception occurs somewhere and reaches the main method and if the main method also throws it out will the jvm handle it like RuntimeExceptions?? [ November 02, 2008: Message edited by: yuvraj kotegar ]
If main() declares that it throws an exception, and indeed, at runtime an exception occurs, then the JVM prints the stack trace of the exception and the main thread halts (i.e., for simple programs, the JVM exits.)
I think the JVM method who is invoking main() method in java has already handled Exception internally , by handling the parent class of all java.lang.Exception. But I am not sure , it should be like this. If any body can answer this, that will be great!!!