By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,739 Members | 2,014 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,739 IT Pros & Developers. It's quick & easy.

checking for null values

P: 1
First i'll introduce myself since I only joined this forum this morning so hey! <waves>

Right to the problem.

I'm reading values from a html file using the getParameter method to produce an applet. Theres 10 sets of data split into 4 sub fields. The applet works fine but i'd like to make the program more robust by checking for null values. Any ideas?

Thanks
Dec 10 '06 #1
Share this Question
Share on Google+
2 Replies


DeMan
100+
P: 1,806
if (fred !=NULL)
{
everything is hunky dory
}
else
{
throw new exception("THings are not so rosy");
}
Dec 10 '06 #2

10K+
P: 13,264
if (fred !=NULL)
{
everything is hunky dory
}
else
{
throw new exception("THings are not so rosy");
}
Expand|Select|Wrap|Line Numbers
  1.  if(fred != null)
Java uses lowercase for null.
Dec 11 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.