Nullabililty in C#
In C# using nullable values like int? would simplify database programming. Unfortunately, java doenst have nullables present until now. Some asked me to use wrapper classes like Integer, but it has
a. Performance penalty
b. Integer(1)!=Integer(1)
Also one nice thing is ?? operator which means “if null”.
int? a=null;
int j=a ?? 1;//j=1
No comments yet.
Leave a comment
-
Recent
-
Links
-
Archives
- December 2009 (2)
- August 2009 (1)
- July 2009 (2)
- April 2009 (4)
- March 2009 (6)
- February 2009 (5)
- January 2009 (4)
- December 2008 (3)
- November 2008 (35)
- October 2008 (20)
-
Categories
-
RSS
Entries RSS
Comments RSS