C# null值

using System;namespace CalculatorApplication {class NullablesAtShow {static void Main(string[] args) {

编程学习网为您整理以下代码实例,主要实现:C# null值,希望可以帮到各位朋友。

using System;

namespace CalculatorApplication {

   class NullablesAtShow {

      static voID Main(string[] args) {
         int? num1 = null;
         int? num2 = 45;
         double? num3 = new double?();
         double? num4 = 3.14157;

         bool? boolval = new bool?();

         // display the values
         Console.Writeline("Nullables at Show: {0}, {1}, {2}, {3}", num1, num2, num3, num4);
         Console.Writeline("A Nullable boolean value: {0}", boolval);
         Console.Readline();
      }
   }
}

本文标题为:C# null值