Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

set string to be null and then check it

843789Jul 5 2010 — edited Jul 6 2010
I tried to do this:

string apple = null;
if (apple == nul){};

just a null pointer exeption, what is the correct way to do so?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2010
Added on Jul 5 2010
41 comments
458 views