Originally posted by Adam Schaible:
De-compile your code, the compiler adds the throws clause.
Originally posted by Adam Schaible:
Essentially the JVM catches your uncaught exceptions, and terminates. Exceptions will "bubble" up the call stack until it's either caught by calling code, or is caught by the jvm.
When you compile:
public static void main(String[] args...){
}
The compiler changes it to:
public static void main(String[] args...) throws Exception {
}
Your calling code then throws the exception to the JVM, it's caught by the JVM, flushed to the error stream, and exits.