title: Same name foe variables in a while loop
body: <p>So my question  is...</p>
  
  <p>Why does the following code complain about the variable name 'wordView' being initialized more than once..</p>
  
  <pre><code> int index = 0;
      TextView wordView = new TextView(this);
      wordView.setText(words.get(index));
      rootview.addView(wordView);
  
      index++;
      TextView wordView = new TextView(this);
      wordView.setText(words.get(index));
      rootview.addView(wordView);
  
      index++;
      TextView wordView = new TextView(this);
      wordView.setText(words.get(index));
      rootview.addView(wordView);
  </code></pre>
  
  <p>but this code doesn't?</p>
  
  <pre><code>int index = 0;
  while(index&lt;words.size()){
      TextView wordView = new TextView(this);
      wordView.setText(words.get(index));
      rootview.addView(wordView);
      index++;
  }
  </code></pre>
  
  <p>it's doing the same thing right?</p>