Satheesh Kumar Pilli
What is Nullable values types?
By Satheesh Kumar Pilli in .NET on Aug 20 2014
  • Rahul Prajapat
    May, 2015 30

    Simply nullable value type have ability to store null value. To declare a nullable value type we need to suffix the type name with "?"Eg-string str=null; //Valid int p=null; //Invalid int? p=null; //Valid

    • 0
  • Navratna Pawale
    Sep, 2014 17

    As we know that, the value type has default value as 0 and reference type has default value as NULL. the convention is that, we cannot assign NULL to value types. But, while working with the databases, it might be have NULL values, because in databases, it is allowed. So, to do this, we have to explicitly assign the NULL values to the Value Types. this can be done by suffixing the ? sign to the type as:- int? i = NULL; then the value type int i will store the NULL value. this is called as Nullable Value Types.

    • 0
  • Satheesh Kumar Pilli
    Aug, 2014 20

    In earlier versions of c# it is not possible to store null values under value types(eg int, float, char...). But in c# 2.0 it is possible to store null values under value types also which gives you more flexibility while communicating with database.To declare a nullable value type we need to suffix the type name with "?"Eg-string str=null; //Valid int p=null; //Invalid int? p=null; //Valid

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS