KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I just got this quiz from a colleague that is driving me crazy. For this snippet of code: var x = new Int32?(); string text = x.ToString(); // No exception Console.WriteLine(text); Type type = x.GetType(); // Bang! Why does the first part .ToString() works without throwing an exception and then the call to GetType() throws a NullReferenceException ?
Tags (comma-separated)
Save Edits
Cancel