--------
Question 132)
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");
}
}
Compiler error complaining about the catch block, where no Throwable object can ever be thrown.
Compiler error - Throwable Object can not be caught, only Exceptions must be caught.
No compiler error. The lines "Before Try" and "At the end" are printed on the screen.
the ans is the 3rd. why?
--------------------------------------------------------------------------------
Question 133)
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");
}
}
Compiler error complaining about the catch block where no IOException object can ever be thrown.
Compiler error - IOException not found. It must be imported in the first line of the code.
No compiler error. The lines "Before Try" and "At the end" are printed on the screen.
the ans is the 1st . why?