EffecitveJava_将局部变量的作用最小化

<p class="MsoNormal" style=""><span style="" lang="EN-US"><span style=""><span style="font-family: Times New Roman;"><span style="font-size: small;">1.</span><span style='font: 7pt "Times New Roman";'> </span></span></span></span><span style=""><span style="font-size: small;">将局部变量的作用最小化最有力的技术是在第一次使用它的地方声明。</span></span></p>
<p class="MsoNormal" style=""><span style="" lang="EN-US"><span style=""><span style="font-family: Times New Roman;"><span style="font-size: small;">2.</span><span style='font: 7pt "Times New Roman";'> </span></span></span></span><span style="font-size: small;"><span style="">如果循环终止后,循环变量不再被需要,则</span><span lang="EN-US"><span style="font-family: Times New Roman;">for</span></span><span style="">循环优先于</span><span lang="EN-US"><span style="font-family: Times New Roman;">while</span></span><span style="">循环。</span></span></p>

你可能感兴趣的:(java)