This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Evaluating a Value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Evaluating a Value" Watch "Evaluating a Value" New topic
Author

Evaluating a Value

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1393
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

Joined: Aug 31, 2004
Posts: 11343

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...


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Evaluating a Value
 
Similar Threads
regex help
Are the rules regarding timing of initialization of final and non-final fields different?
Accessing an object within a Set in a bean
concat 2 strings using constructor
Bean Autowiring, PropertyPlaceholderConfigurer