title: Java declaring iterator outside for loop
body: <p>According to the documentation of Oracle for loop is formed as we know it:</p>
  
  <pre><code>for (initialization; termination; increment) {
      statement(s)
  }
  </code></pre>
  
  <p>E.g.,</p>
  
  <pre><code>class ForDemo {
      public static void main(String[] args){
           for(int i=1; i&lt;11; i++){
                System.out.println("Count is: " + i);
           }
      }
  }
  </code></pre>
  
  <p>Why can't we declare the initialization part outside the for loop like this?  </p>
  
  <pre><code> class ForDemo {
      public static void main(String[] args){
           int i = 1;
           for(i; i&lt;11; i++){
                System.out.println("Count is: " + i);
           }
      }
  }
  </code></pre>