C
cody
What happens when:
int? n = null;
int i = n;
I suppose and NullReferenceException or similar should be thrown but in the
official documents nothing is said about that.
However I find the nullable types one of the absolutely greatest inventions
in programming languages ever.
I especially like the coelescing operator ?? because I find myself very
often to write something like
Text = obj==null ? "" : obj.ToString(); which will then be Text =
obj.ToString() ?? "";
int? n = null;
int i = n;
I suppose and NullReferenceException or similar should be thrown but in the
official documents nothing is said about that.
However I find the nullable types one of the absolutely greatest inventions
in programming languages ever.
I especially like the coelescing operator ?? because I find myself very
often to write something like
Text = obj==null ? "" : obj.ToString(); which will then be Text =
obj.ToString() ?? "";