Results 1 to 4 of 4

Thread: Explanation for Nullable Types in detail - C#

  1. #1
    Join Date
    Nov 2009
    Posts
    67

    Explanation for Nullable Types in detail - C#

    I am interested in learning programming languages. I have already leart Java, C, C++ and HTML. Now recently I have started to Csharp. Although quite interesting, I am finding some of its feature difficult to understand. There is this one feature of Csharp known as Nullable Types. I have been not able to percieve what excatly is Nullable Types in Csharp.

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    Re: Explanation for Nullable Types in detail - C#

    C# 2.0 has introduced many new key features which are really very helpful. Nullable types is one of this key features. We can define a Nullable type as a particular data type which consists o the defined data type value or the null value. If a value type variable can be assigned the value of Null, it is said to represent a Nullable Type in C#. Nullable types are used to overcome the short comings of value types as they cannot hold a Null value.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Explanation for Nullable Types in detail - C#

    From the name itself it is very clear that Nullable types have the ability to store value of Null. Therefore, a nullable type can represent the normal range of values for its underlying value type, plus an additional null value. They are similar to generic data types with the only difference being a wrapper structure written aroung the generic data type which permits it to store value of Null. Nullable types in Csharp are instances of the System.Nullable struct.

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Explanation for Nullable Types in detail - C#

    Csharp has succesfully brought out many interesting concepts through C# 2.0. One exiting concept is the that of the Nullable Types in Csharp. Nullable types makes it possible for you, where you are able to have a primitive type with a null or unknown value. A nullable type can be declared similar to normal variable but with ? modifier at the end of keyword.
    eg.
    int? Val = null;
    or
    Nullable<int> Val = null;
    where we can use int? instead of Nullable<int>

Similar Threads

  1. Need help regarding the log entry and its explanation.
    By Shazid in forum Networking & Security
    Replies: 3
    Last Post: 09-05-2011, 07:58 AM
  2. Properties doesn't use nullable types in C#
    By MACE in forum Software Development
    Replies: 6
    Last Post: 01-09-2010, 03:59 PM
  3. Keyboard key explanation
    By Baazigar in forum Tips & Tweaks
    Replies: 3
    Last Post: 29-03-2010, 07:47 PM
  4. Explanation about OpenSSL in PHP
    By hatred in forum Software Development
    Replies: 5
    Last Post: 07-03-2010, 04:10 AM
  5. Explanation on Parser, Sax and Dom
    By Ernesto4 in forum Software Development
    Replies: 3
    Last Post: 21-11-2009, 04:03 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,504,141.89815 seconds with 16 queries