Tony Collen <[EMAIL PROTECTED]> writes:

> Likewise, I've seen something like this in code... can't remember if it's
> anywhere in Cocoon:
> 
> if ( "something".equals(stringToCompare) {

[ versus... ]

> if ( stringToCompare.equals("something") ) {
> 
> Is this just a matter of style as well?  The first way seems goofy if you
> ask me.

Well, the first form works even if stringToCompare is null, the second
one will raise an exception in that case.

-- 
Stephen L. Peters                                  [EMAIL PROTECTED]
  GPG fingerprint: A1BF 5A81 03E7 47CE 71E0  3BD4 8DA6 9268 5BB6 4BBE
     "Poodle: The other white meat." -- Sherman, Sherman's Lagoon

Reply via email to