Which is the 'correct' way to do this (if statement)
<p>I've got plenty of these lying around, and I'm wondering if I'm going to face any trouble - or performance problems.</p>

<p>I have method A:
<pre><code>
MyClass monkey;
...
if(monkey != null) {
 ...
}
</pre></code></p>

<p>Or method B:
<pre><code>
boolean hasMonkey; //This is set to TRUE when monkey is not null
MyClass monkey;
...
if(hasMonkey) {
 ...
}
</pre></code></p>

<p>On a functional level, they both do the same thing. Right now, I'm using method A. Is that a bad way of doing things? Which is going to perform better?</p>
