There was a compile time error 'Unreachable catch block for FileNotFoundException. The exception is never thrown from the try block'
Same for IOException.
But when I tried to catch Exception, no compile time error was displayed! Why is that so?
I'd say...read up on checked/unchecked exceptions and try to understand their implications. Also, read this
JLS-section 14.21 to understand the circumstances in which a catch becomes un-reachable.