This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get rid of NullPointer Exception(urgent)

 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to check whether a ref variable is equal to null r not.How can i do this without getting nullpointerexception?
i.e
RefType variable = null;
Here, the RefType is not String
I want to chk whether variable is eaqual to null r not.
Thanks in Advance,
Vineela
[ April 21, 2004: Message edited by: Vineela Devi Jakka ]
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what about simply

???
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to Java in General (Beginner)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic