These 2 codes are taken from an mock exam:
1.public class AQuestion
{
public static void main(
String args[])
{
System.out.println("Before Try");
try
{
}
catch(Throwable t)
{
System.out.println("Inside Catch");
}
System.out.println("At the End");
}
}
2.public class AQuestion
{
public static void main(String args[])
{
System.out.println("Before Try");
try
{
}
catch(java.io.IOException t)
{
System.out.println("Inside Catch");
}
System.out.println("At the End");
}
}
Could someone give me some explanations why code 1 compile without no problem and code 2 complains about no IOException object can ever be thrown.
Thanks in advance.