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!

Integer comparison with null problem

675867Jan 6 2009 — edited Jan 21 2009
hi all
i ve an Integer object

Integer intObj;

then i want to test if this object is null

if(intObj==null)
{
}

it throws null pointer exception

i solved problem by reversing the test if(intObj!=null)

but i want to understand wat causes the problem ???
and how i treat this
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 18 2009
Added on Jan 6 2009
20 comments
2,971 views