I have noticed that there are 2 kinds of checked exceptions:
1)
public static void main (String []args)
{
try{
//no exception thrown here, it still compiles though.
}
catch(Exception e){System.out.println(e);}
}
2)
public static void main (String []args)
{
try{
// it does not compile if not written any code which potentially might throw it
}
catch(IOException io){System.out.println(io);}
}
Is there any rule to anticipate this behaviour? to know in advance which is not mandatory to be present and it is? Hope I have been quite clear with explaining the issue. Thanks, Indeed ItIs