using System;
using System.Collections;
namespace Articulos.Cap04.Excepciones.Parte5
{
public sealed class UsoNullReferenceException
{
public static void Main()
{
// Define una variable de tipo ArrayList, sin embargo
// aún no ha sido inicializada. Sólo con null:
ArrayList al = null;
try
{
// Intento de agregar un elemento a la
// variable ArrayList:
al.Add ("Blog xCSw");
}
catch (NullReferenceException mre)
{
Console.WriteLine ("Mensaje de error: `{0}`", mre.Message);
}
}
}
}