Sunday, 17 April 2011

Is it valid to place some code in between try the catch/finally block that follows it?

No. There should not be any line of code present between the try and the catch/finally block. e.g. The following code is wrong.
try{}
String str = “ABC”;
System.out.println(“str = “+str);
catch(Exception e){}

No comments:

Post a Comment