• Post Reply Bookmark Topic Watch Topic
  • New Topic

Evaluating a Value  RSS feed

 
Steve Dyke
Ranch Hand
Posts: 1776
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I determin what value this.changeaffects1 has so I can give it a value of 0 if it is null?

 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These appear to reference Strings, so I'm not sure what you mean about giving it a value of 0 if it is null. My guess is that you want to assign an empty String ("") to the variable if it's null. If so, you can use something like...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!