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

Live Comment Preview:

 
«aprile»
domlunmarmergiovensab
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011