NULLABLE TYPES IN C# Programming
Nullable types are specific wrappers around the value types(as int,double and bool) that allows storing data with a null value .This provides opportunity for types that generrally do not allow lack value (i.e value null) to be used as a reference types and to accept both normel value and special one null .Thus the nullable types hold an optional value.
wrapping a given type as nullable can be done in two ways :
Both declarations are equivalent .The easiest way to perform the operation is to add a question mark? after the type ,for example int? , the more difficult is to use the Nullable<...> syntax.
Nullable type are references type i.e they are reference to an object in the daynamic memory ,which contain their actual value .They may or may not have a value can be used as a normal primitive data types ,but with some specifics , which are illustrated in the following example :
0 Comments