Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> String myString = "" + someArbitaryObject.getArbitaryValue(); > If the method getArbitaryValue() returns a null, you will get a string object created with the value "null". This has caused me hours of fun trying to debug code like this in the past, so it's worth watching out for.
This wouldn't work if the method returned a primative, but I assume it doesn't because in that case, it couldn't return null. Except for primatives, where the various purmutations of - mfg
Replies:
|
Sponsored Links
|