Throw Null reference Exception : Buildin Exceptions : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Buildin Exceptions »

 

Throw Null reference Exception








    

using System;
using System.Collections;

class Class1 {
   static void Main(string[] args) {
    Exception objException = new Exception();

    try {
      objException = null;
      Console.WriteLine(objException.Message);
    } catch (Exception objE) {
      Console.WriteLine(objE.ToString());
    }
   }
}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Buildin Exceptions