Throwing a predefined exception. - CSharp Custom Type

CSharp examples for Custom Type:Exception

Description

Throwing a predefined exception.

Demo Code

using System;//from   w w w.  ja v  a  2  s .  c o  m
class Zero
{
   public static void Main()
   {
      Console.WriteLine("Before Exception...");
      throw( new DivideByZeroException() );
      Console.WriteLine("After Exception...");
   }
}

Related Tutorials