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)


 
 
 

Live Comment Preview:

 
«maggio»
domlunmarmergiovensab
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567