<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Nagise</author_name>
  <author_url>https://blog.hatena.ne.jp/Nagise/</author_url>
  <blog_title>プログラマーの脳みそ</blog_title>
  <blog_url>https://nagise.hatenablog.jp/</blog_url>
  <categories>
    <anon>Java</anon>
  </categories>
  <description>入門書ではあまりとりあげられない部分を解説するコンセプトの「入門書が教えてくれないJava」シリーズの第二弾。前回は変数についてだった。今回はそのスコープについて取り上げたい。 スコープとは スコープとは大雑把に言えば変数やメソッドなどが見える範囲のことを指す。Javaの変数のスコープで一番簡単なのはローカル変数で、これは{から}まで（これをブロックという）の中で、宣言した位置より後ろで参照することができる。 public void main(String[] args) { int i1 = 0; // i1はここからmainの}までの間で参照できる if (true) { int i2 =…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnagise.hatenablog.jp%2Fentry%2F20160425%2F1461589722&quot; title=&quot; 入門書が教えてくれないJava スコープ編 - プログラマーの脳みそ&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-04-25 22:08:42</published>
  <title> 入門書が教えてくれないJava スコープ編</title>
  <type>rich</type>
  <url>https://nagise.hatenablog.jp/entry/20160425/1461589722</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
