Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

What does "DateTime?" mean in C#?

Since DateTime is a struct, not a class, you get a DateTime object, not a reference
, when you declare a field or variable of that type.

And, in the same way as an int cannot be null, so this DateTime object can never 
be null, because it's not a reference.

Adding the question mark turns it into a nullable type, which means that either 
it is a DateTime object, or it is null.

DateTime? is syntactic sugar for Nullable<DateTime>, where Nullable 
is itself a struct
Comment

PREVIOUS NEXT
Code Example
Csharp :: displaying list in gameobject Unity 
Csharp :: 2d movement unity 
Csharp :: remove lines from textfile 
Csharp :: ef core unique index 
Csharp :: Web forms switch page 
Csharp :: c# .net calculate md5 
Csharp :: init stirng list c# 
Csharp :: nunit return parameter 
Csharp :: asp.net list find 
Csharp :: percentage random c# 
Csharp :: copy properties from two subclasses c# 
Csharp :: Difference between Math.Floor() and Math.Truncate() 
Csharp :: eleventy set default layout 
Csharp :: unity get layermask 
Csharp :: set main camera unity 
Csharp :: c# convert string to datetime 
Csharp :: c# stream 
Csharp :: c# exists in list 
Csharp :: how to print a variable in c# 
Csharp :: how to change the width of a panel unity 
Csharp :: how to scale text from center in unity 
Csharp :: _swapbatch.foreach multiple statements c# 
Html :: fevicon 
Html :: font awesome icon 6 cdn 
Html :: sample text 
Html :: how to remove download option from video tag in html 
Html :: bootstrap a link disabled 
Html :: a href mail 
Html :: conveert text to uppercase in input field 
Html :: horizontal line html react 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =