In the following class I can't understand why the compiler complains when using
catch(java.io.IOException t)
where it doesn't with either :
catch(Throwable t) // OK
OR
catch(Exception t) // OK
Is it the compiler responsability to do it that way ?
Thanks
public class AQuestion
{
public static void main(
String args[])
{
System.out.println("Before Try");
try
{
// Nothing here
}
// catch(Throwable t) // OK
// catch(Exception t) // OK
catch(java.io.IOException t) // doesn't compile
{
System.out.println("Inside Catch");
}
System.out.println("At the End");
}
}