What are checked exceptions? A checked exception is any exception that is listed in the throws clause of a method and not an ancestor of RuntimeException. For example:
The compiler will complain on the call to test2() because IOException is a checked Exception, so you must wrap the call in a try-catch block:
Also take note of the fact that even though test1() is declared to throw RuntimeException, the compiler doesn't make any effort to enforce that as it does with the IOException. It is really a waste of time to declare a throws RuntimeException because the fact is any method can unexpectedly throw a RuntimeException.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher