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 1 and 5 and type the answer here:
 

Live Comment Preview:

 
«settembre»
domlunmarmergiovensab
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345