What if you did this:
instead of:Code:myObject newObj = null;
Code:myObj newObj;
What if you did this:
instead of:Code:myObject newObj = null;
Code:myObj newObj;
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
is it because it expects you to do something in if or else section???
It is null by default. And like I said, it's not an actual error. It's just a warning. It's basically saying that you haven't assigned it anything. This COULD be a problem if you didn't have the proper checks in place, i.e., if you didn't check if it was null it would result in an object reference error.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
jmurrayhead
If you agree, give me rep.
If you like it here...throw us a few bones to help support us.
Bookmarks