Hi,
What is nullable type in c sharp.
Thanks.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rakesh Jha85 reputationPosted Oct 6, 2011, 9:05 PM EDT
TulasiRank #2,544 · 549 reputationPosted Oct 6, 2011, 9:30 PM EDT
Nullable in .Net 2.0, helps to determine whether variable has been assigned a value or not,lets take a small example
int? a=null; //means this value might be null
if(a.HasValue)
a.Value.toString() //a.HasValue return true if it contains value
else
return "null value";
int b=null ;//error
Example: Quiz application having option yes/no, but it should displayed "Not Attempted" when user does not make any choice.
chk this url : http://www.codeproject.com/KB/cs/c__20_nullable_types.aspx
If this helps you, then mark as "Correct Answer"
Thank You
Prabhu RajaRank #861 · 2.6K reputationPosted Oct 6, 2011, 9:50 PM EDT
Nullable types Placed, where you want to be able to have a primitive type with a null (or unknown) value.
For More Reference: Nullable Types in C#
VulpesRank #55 · 29.2K reputationPosted Oct 7, 2011, 1:23 AM EDT