Thursday, 27 January 2011

what are Nullable Types in C#


Nullable Types are the same generic data type.

If any object of the generic type has the '?' attached to the data type while declaring the value object. It denotes the object is a Nullable object of that data type
e.g. if I declare the RollNumber as
Public int ?RollNo=null;
The RollNumber declared above is Nullable roll number that means assigning the value null to the Rollnumber is valid and completely acceptable.
It has 2 properties
Hasvalue =A boolean property denoting validity of value containing in the object
value=A value contained in the object.

No comments:

Post a Comment