Welcome to jBasket Interviews, where you can ask questions and receive answers from other members about job interviews and job seeking tips.

Can DateTimes be null?

0 votes
DateTime t = null;
Is the above statement valid ?
asked 1 year ago by hiro.numara (470 points)

1 Answer

–1 vote
try compiling and running it, takes less time than posting this question.

p.s. its valid, its not actually a datetime-value, but a datetime-object, which contains a datetime value.. and as we know of objectreferences, they can be null.
answered 1 year ago by anonymous
hmmm, datetime is a value type, not reference type in C#, so it cannot be null
1 year ago by anonymous

Related questions