Inadvertently on the firstProgram-Datetime? , (I don't know if you have never used it again, but I met it for the first time). I found out the information later.It is a new feature of C #2.0,It can be a null value. I do not know if this explanation is correct. If there is a mistake, please correct it. ^_^! The following is the code from msdn:
Using System;
Class Sample
{
Public Static Void Main ()
{
Datetime ? Mynow;
// Assign the current date and time to mynow then display its value.
Mynow = Datetime. now;
Display (mynow, " 1) " );
// Assign null (nothing in Visual Basic) to mynow then display its value.
Mynow = Null ;
Display (mynow, " 2) " );
}
// Display the date and time.
Public Static Void Display (datetime ? Displaydatetime, String Title)
{
// If a value is defined for the displaydatetime argument, display its value; otherwise,
// Display that no value is defined.
Console. Write (title );
If (Displaydatetime. hasvalue = True )
Console. writeline ( " The date and time is {0: f }. " , Displaydatetime. value );
Else
Console. writeline ( " The date and time is not defined. " );
}
}
/*
This code example produces the following results:
1) The date and time is Tuesday, 4:16:06.
2) The date and time is not defined.
*/