NULLABLE TYPES

Home Forums General Programming C# NULLABLE TYPES

This topic contains 0 replies, has 2 voices, and was last updated by  Hirendra Sisodiya 6 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3268

    Pavan
    Moderator

    Nullable types are instances of the System.Nullable struct. A nullable type can represent the normal range of values for its underlying value type, plus an additional null value. For example, a Nullable, pronounced “Nullable of Int32,” can be assigned any value from -2147483648 to 2147483647, or it can be assigned the null value. A Nullable can be assigned the values true or false, or null.
    The ability to assign null to numeric and Boolean types is particularly useful when dealing with databases and other data types containing elements that may not be assigned a value. For example, a Boolean field in a database can store the values true or false, or it may be undefined.

    int? i = 10;
    double? d1 = 3.14;
    bool? flag = null;
    char? letter = 'a';
    int?[] arr = new int?[10];
    

    #3280

    hi friends

    You can use nullable in vb.net as:

       Dim i As Nullable(Of Integer) = Nothing
    

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.