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");
}
}
1.Compiler error complaining about the catch block where no IOException object can ever be thrown.
2.Compiler error - IOException not found. It must be imported in the first line of the code.
3.No compiler error. The lines "Before Try" and "At the end" are printed on the screen.
Answer is given as 1.
If the body of try block does not contain any code, can't we catch any exception?