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 #51

Il seguente snippet, quante volte stampa Ciao a console, e perché?

using System;
 
class Foo
{
      public Foo()
      {
            Console.WriteLine(this);
      }
      public static Foo MyField = new Ciao();
}
 
class Ciao: Foo
{
      public static Foo MyProperty { get { return new Ciao(); } }
}
 
class Test
{
      static void Main()
      {
            Console.WriteLine(Ciao.MyProperty);
      }
}

  • A. 1
  • B. 2
  • C. 3
  • D. StackOverflowException

Troppo semplice, basta un po' di attenzione...

Print | posted on martedì 12 luglio 2005 19:55 | Filed Under [ Quiz Sharp ]

Powered by:
Powered By Subtext Powered By ASP.NET