This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
only case 1 will result in compile Error: "exception java.io.IOException is never thrown in body of corresponding try statement" i am confused with the outcome: is the error above occurs only on checked exception? if so, how come both case 4,5 compiles successfully? because Exception and Throwable are supposed to be checked exception? or not?
It's because both Exception and Throwable have unchecked exceptions as subclasses. So where you sayWhen the compiler tries to figure out whether your catch clause can ever be executed, it comes up with the answer "yes" because it assumes that an unchecked RuntimeException can always be thrown, anywhere. And a RuntimeException or subclass would be caught by your Exception catch clause. Same story for Throwable, except that that will catch Error as well. - Peter
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com