Variable declaration inside a loop
<p>One common dilemma I have faced throughout programming is regarding declaring variables inside a loop. Say I have to perform something like the following: </p>

<pre><code>List list=myObject.getList();
Iterator itr=list.iterator();
while (itr.hasNext()){
    BusinessObject myBo=(BusinessObject)itr.next();
    process(myBo);
}
</code></pre>

<p>In the above snippet, should <code>myBo</code> be declared outside the loop or does declaring it inside the loop not cause harm to memory and performance?</p>
