<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hjm333</author_name>
  <author_url>https://blog.hatena.ne.jp/hjm333/</author_url>
  <blog_title>The King's Museum</blog_title>
  <blog_url>https://hjm333.hatenablog.com/</blog_url>
  <categories>
    <anon>Effective Java</anon>
    <anon>Java</anon>
  </categories>
  <description>ローカル変数のスコープは最小限にするべきです。 Java では古いバージョンの C 言語と違って、文が書ける場所であれば変数宣言を書くことができます。 スコープの先頭ですべての変数を宣言せず必要な箇所で変数を宣言すれば、変数のスコープを最低限に保てます。 加えて、ローカル変数宣言はほとんどの場合、初期化されるべきです。 唯一の例外は try-catch の部分です。 while よりも for Iterator を走査する場合は while ループよりも for の方が望ましいです。 while ループの場合はより大きなスコープに変数を宣言する必要があるからです。 Iterator&lt;Eleme…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhjm333.hatenablog.com%2Fentry%2F2016%2F06%2F19%2F225459&quot; title=&quot;【Effective Java】項目４５：ローカル変数のスコープを最小限にする - The King&amp;#39;s Museum&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-06-19 22:54:59</published>
  <title>【Effective Java】項目４５：ローカル変数のスコープを最小限にする</title>
  <type>rich</type>
  <url>https://hjm333.hatenablog.com/entry/2016/06/19/225459</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
