Catch Block With Exception Object

image_pdfimage_print
   


using System;
using System.Collections;

class Class1 {
   static void Main(string[] args) {
    long lngResult;
    long lngValue = 0;

    try {
      lngResult = 8 / lngValue;
    }
    catch (Exception objE) {
      Console.WriteLine(objE.ToString());
    }
   }
}