Sembra facile... Ma non è difficile!

Quiz del lunedi... Considerate il seguente snippet:

class Class1
{
    [STAThread]
    static void Main(string[] args)
    {
        object s = null;
        string s2 = (string) s;
    }
}

Vi aspettate:

  • Una InvalidCastException
  • Una NullReferenceException
  • Nulla, funziona perfettamente

Ora provate ad implementarlo... Sorpresi? :-)

posted @ lunedì 17 maggio 2004 21:50

Print

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
Please add 4 and 8 and type the answer here:
 

Live Comment Preview:

 
«ottobre»
domlunmarmergiovensab
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789