You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
608 B
C#

/*
* C# Program to Ilustrate Nullable Data Types
*/
using System;
namespace Application
{
class Nullables
{
static void Main(string[] args)
{
int? num1 = null;
int? num2 = 100;
double? num3 = new double?();
double? num4 = 3.14157;
bool? boolval = new bool?();
Console.WriteLine("Nullables : {0}, {1}, {2}, {3}",
num1, num2, num3, num4);
Console.WriteLine("A Nullable boolean value: {0}", boolval);
Console.ReadLine();
}
}
}
/*
Nullables : ,100,,3.1457
A Nullable Boolean Value :