using System;
class Program
{
static void Main()
{
int a = 10, b = 5;
try
{
Console.WriteLine("I'm from Try Block :" + a / b);
}
catch (Exception e)
{
Console.WriteLine("I'm from Catch Block, " + e.Message);
}
finally
{
Console.WriteLine("I'm always run from Finally");
}
Console.ReadLine();
}
}
|
Class Program
Private Shared Sub Main()
Dim a As Integer = 10, b As Integer = 5
Try
Console.WriteLine("I'm from Try Block :" + a \ b)
Catch e As Exception
Console.WriteLine("I'm from CatchBlock, " + e.Message)
Finally
Console.WriteLine("I'm always run from Finally")
End Try
Console.ReadLine()
End Sub
End Class
|