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 27

using System;

class Foo1
{
  public override string ToString()
  {
    return "Foo1";
  }
}

class Foo2: Foo1
{
  private new string ToString()
  {
    return "Foo2";
  }
}

class Foo3: Foo2
{
  public override string ToString()
  {
    return base.ToString();
  }
}

class Foo
{
  static void Main()
  {
    Console.WriteLine(new Foo3().ToString());
    Console.Read();
  }
}

Cosa viene visualizzato a console?

  • A. Foo1
  • B. Foo2
  • C. Questo è il mio 100° post! :-)
  • D. non compila ('Foo2.ToString()' is inaccessible due to its protection level)

Print | posted on lunedì 14 giugno 2004 14:14 | Filed Under [ Quiz Sharp ]

Powered by:
Powered By Subtext Powered By ASP.NET