Consider the following code:
public class MQ1
{
public static void main(
String args[])
{
System.out.println("Before Try");
try
{
}
catch(java.io.IOException t) //1
//catch(Exception t) //2
{
System.out.println("Inside Catch");
}
System.out.println("At the End");
}
}
As //1 showed,this code won't compile with error that no IOException is thrown in try block.
But if //1 is replaced with //2
it compiles without problem.
I can not understand what is behind this.
Please clear it for me
THX