Now, in the case of && (short circuit operation) if x is null, the statement will terminate after the first expression *BUT* if & was used in its place, this would throw a null pointer exception anytime x was null since it would always execute both sides.
There are other cases (I've leave that to the reader think about) where you always want both sides to be executed regardless of whether they both return true/false, although I'd tend to suspect such code to be somewhat unclear from the normal coding techniques of java. [ March 21, 2006: Message edited by: Scott Selikoff ]
Originally posted by Rusty Shackleford: There really isn't a reason to need to use it like that.
That's not completely true, if the code you were writing invoked methods that performed some kind of recovery in the event one side was false, you *might* want both sides to be executed. This amounts to side effect methods that as I said in my original post, is not commonly practicied in java.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com