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 ";
}
}
{
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 ";
}
}
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());
}}
An Exception