title: Java: Initialize multiple variables in for loop init?
body: <p>I want to have two loop variables of different types. Is there any way to make this work?</p>
  
  <pre><code>@Override
  public T get(int index) throws IndexOutOfBoundsException {
      // syntax error on first 'int'
      for (Node&lt;T&gt; current = first, int currentIndex; current != null; 
              current = current.next, currentIndex++) {
          if (currentIndex == index) {
              return current.datum;
          }
      }
      throw new IndexOutOfBoundsException();
  }
  </code></pre>