写法1:
public int a()
{
   int i=0;
   try
   {
       do sonething;
       i++;
   }
   catch
   {
      throw new Exception("一个异常!");
   }
   return i;
}写法2:
public int a()
{
   try
   {
      do something;
      int i=0;
      return i++;
   }
   catch
   {
      throw new Exception("一个异常!");
   }
}
在net中1和2都通过编译,而在java中2无法通过,大家看一下。