Search This Blog

Saturday, 7 September 2013

Concept of Nullable Value in C#

Concept of Nullbale values in C#

using System;

public class NullValue
{
   public static void Main(String[] args)
   {
      int ?num1 = null;
      int? num2 = 45;
      Console.WriteLine("Values are:{0},{1}",num1,num2);
      Console.ReadLine();
   }
}

// here {0} and {1} are placeHolders 
// also we can write it as
//Console.WriteLine("Values are:"+num1+" "+num2);

output:



No comments:

Popular Posts