Example of catching the NullReferenceException

public void Main()
{
            try
            {
                int ? number = null;
                Console.WriteLine(number.ToString());

            }
            catch (NullReferenceException)
            {
                MessageBox.Show("Null Reference Exception Caught");

            } 
}