Web Log di Adrian Florea

"You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away." Antoine de Saint-Exupery
posts - 440, comments - 2715, trackbacks - 3944

My Links

Archives

Post Categories

Image Galleries

.RO Blogs

.RO People

.RO Sites

Blogs

Furls

Links

vinCitori

Quiz Sharp #45

using System;

class MyNullReferenceException: NullReferenceException
{
  public override string Message
  {
    get{return "Ciao!";}
  }
}

class Foo
{
  static void Main()
  {
    try
   
{
      throw null as MyNullReferenceException;
    }
    catch(MyNullReferenceException e)
    {
      Console.WriteLine(e.Message);
    }
    catch(NullReferenceException e)
    {
      Console.WriteLine(e.Message);
    }
  }
}

Cosa viene visualizzato a console e perché?

  • A. Object reference not set to an instance of an object.
  • B. Ciao!
  • C. non compila
  • D. errore a run-time

Print | posted on venerdì 11 febbraio 2005 10:38 | Filed Under [ Quiz Sharp ]

Powered by:
Powered By Subtext Powered By ASP.NET