Originally posted by Ravi Pinnaboyina:
Is it that U need a code that can generate IOException to have a catch block for IOException.
Is this same even for remaining Exceptions ???
Then If dont write a any code and keep an Exception catch block why is this not complaining?
Is this behaviour specific to IOException only???
An Exception includes checked exceptions like the IOException, and unchecked exceptions, as RuntimeException is a subclass of the Exception. This behavior is specific to all checked exceptions.
Unchecked exceptions, and exceptions that include unchecked exceptions, can't be confirmed to not be thrown, hence, allowed.
Henry