Hi,
What is nullable type in c sharp.
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Oct 7, 2011, 5:23 AM
Prabhu RajaPosted Oct 7, 2011, 1:50 AM
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#
TulasiPosted Oct 7, 2011, 1:30 AM
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
Rakesh JhaPosted Oct 7, 2011, 1:05 AM