C#

Exception Handling concept using C# Language

Exception Handling concept using C# Language
using System;



class MyClient

{

   public static void Main()

   {

      int x = 0;

      int div = 0;



      try

       {

          div = 100/x;



          Console.WriteLine("Not executed line");

       }

         catch(DivideByZeroException de)

           {

               Console.WriteLine("\nDivideByZeroException" );

            }



         catch(Exception ee)

           {

               Console.WriteLine("\nException" );

            }

         finally

           {

               Console.WriteLine("\nFinally Block");

            }

         Console.WriteLine("\nResult is {0}",div);

    }

}
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.