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

using System;
using System.Reflection;

class Foo
{
  public Foo()
  {
    int[] a = new int[3]{1, 2, 3};
    foreach(int i in a)
    {
      Console.Write(i);
    }
    Console.WriteLine();
  }
 
  static void Main()
  {
     try
   
{
      Activator.CreateInstance(Assembly.GetExecutingAssembly().GetTypes()[2]);
    }
    catch(IndexOutOfRangeException e)
    {
      Console.WriteLine("abc");
    }
  }
}

Cosa stampa a console e perché?

  • A. 123
  • B. abc
  • C. non viene stampato nulla

La frase del giorno: "due anni in Garabagna, circa altrettanti nel paese della Magia, un po' meno a Poddema" - Henri Michaux

Print | posted on venerdì 1 aprile 2005 19:26 | Filed Under [ Quiz Sharp ]

Powered by:
Powered By Subtext Powered By ASP.NET