Where shall variables be defined within a method?
<p>Suppose, I have a method with a parameter of <code>Object</code> type.
The method returns nothing - <code>void</code>.</p>

<p>First it checks whether the parameter is not null (or any other check, like <code>objectParam.isEnabled()</code>)</p>

<pre><code>if (objectParam.isEnabled()) {
    // ok
}
</code></pre>

<p>Now, if the condition is satisfied, I need local variables. If it's not, then I don't need any variables.</p>

<p>WHERE SHOULD I define them? Inside the "if scope" or just after the method header?</p>

<p>Of course, I can do it wherever I like, but which way should be a better practice?</p>
