Runtime exceptions make it impossible to know what exceptions can be emitted by a method. They also result in incosistent throws decls among developers. Describe subsumption to people: subsumption is often how IOException derivatives are dealt with (subsumption is casting to the base class). The most vituperative debate is between those who believe unchecked exceptions make mechanical testing nearly impossible, and those who believe that checked exceptions impinge on polymorphism by making the exception list part of the method signature (and thereby inheritable).
The top example comes from the JDK documentation.
This is a perfect demonstration of why there are unchecked exceptions. It is likely that 99% of the time this method is called, there will be no problem. However, because the exception is checked, it must always be handled!
The following resources must be managed explicitly: graphics contexts, file handles, sockets ,Windows, Image, and jdbc resources.
be careful about the close() method raising an exception.
The ‘end of while’ statement is never reached. finally blocks can alter the return value, even if a return was what caused the finally block to be invoked. finally blocks can manage all transfers of control…