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