class MyClass
{
static void Main()
{
System.Console.WriteLine(new MyClass().Foo());
}
string Foo()
{
try
{
throw new System.Exception("An Exception ");
System.Console.Write("Inside try ");
}
catch(System.Exception ex )
{
return ex.Message;
}
finally
{
System.Console.Write("Finally ");
}
return "Outside try ";
}
}

解决方案 »

  1.   

    你的这个是C#写的吧public class MyClass {


    private String Foo() {
    try {
    throw new Exception("An Exception ");
    // System.out.println("Inside try ");
    } catch (Exception ex) {
    return ex.getMessage();
    } finally {
    System.out.println("Finally ");
    }
    // return "Outside try ";
    }


    public static void main(String []args) {

    System.out.println(new MyClass().Foo());
    }}
      

  2.   

    Finally 
    An Exception