Friday, 8 July 2016

What are Nullable types in C#?coalescing operator: ?

Nullable:-

C# provides a special data types, the nullable types, to which you can assign normal range of values as well as null values.


For example, you can store any value from -2,147,483,648 to 2,147,483,647 or null in a Nullable<Int32> variable. Similarly, you can assign true, false, or null in a Nullable<bool> variable.

coalescing operator: 
The Null coalescing operator is used with the Nullable value types and reference types. It is used for converting an operand to the type of another nullable (or not) value type operand, where an implicit conversion is possible.
If the value of the first operand is null, then the operator returns the value of the second operand, otherwise it returns the value of the first operand.


No comments:

Post a Comment