Re: What is that question (?) sign after a type declaration?
- From: Pavel Minaev <int19h@xxxxxxxxx>
- Date: Wed, 18 Jun 2008 07:14:15 -0700 (PDT)
On Jun 18, 6:06 pm, "....DotNet4Ever...." <hate.s...@xxxxxxxxxxx>
wrote:
I have been noticing declarations like this:
private DateTime? _creationdate;
and have been wondering what is the function or meaning of that question
sign after the member type name. I searched the web but naturally with such
a thing in a query yields a lot of noise and no suitable results.
Can somebody enlighten me?
"T?" is syntactic sugar for writing "System.Nullable<T>". You can look
up the details on the latter in MSDN, but briefly, it is a type that
wraps any other value type, and adds null to its domain of values. So,
in your example, _creationdate can be either a DateTime, or null.
.
- References:
- What is that question (?) sign after a type declaration?
- From: ....DotNet4Ever....
- What is that question (?) sign after a type declaration?
- Prev by Date: Re: Can a generic class re-create itself with another type
- Next by Date: Re: An object reference is required for the non-static field, method, or property message
- Previous by thread: What is that question (?) sign after a type declaration?
- Next by thread: compile error problems
- Index(es):
Relevant Pages
|