Re: Check for null object
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Sep 2006 14:53:45 -0400
What do you mean it doesn't work? That is indeed the correct way to
check for null.
However, I suspect you are getting a compiler error telling you that the
test variable is not initialized. You might want to fix that first.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Tarun Mistry" <nospam@xxxxxxxxxx> wrote in message
news:%23TNVbwB3GHA.2196@xxxxxxxxxxxxxxxxxxxxxxx
Hi guys,
what is the best/correct way to check for a NULL object?
I.e.
myClass test;
if(test == null) {}
This doesnt work.
Thanks
Taz
.
- References:
- Check for null object
- From: Tarun Mistry
- Check for null object
- Prev by Date: Re: Restricting webservice..
- Next by Date: Re: Check for null object
- Previous by thread: Check for null object
- Next by thread: Re: Check for null object
- Index(es):
Relevant Pages
|