March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
namespace Samples
{
public class DivideByZeroExceptionSample
{
public static void Main()
{
try
{
int i = 0;
Console.WriteLine(42 / i);
}
catch(DivideByZeroException e)
{
Console.WriteLine("Exception: {0}", e);
}
}
}
}
Exception: System.DivideByZeroException: Attempted to divide by zero. at Samples.DivideByZeroExceptionSample.Main() in C:\Books\BCL\Samples\ System\DivideByZeroException\DivideByZeroException.cs:line 12
Read now
Unlock full access