title: How do I reference a user-entered int?
body: <p>Easy question (I'm a beginner!)... My java program needs to refer back to the user-entered integers stored as variables "a" and "z". These two variables are initialized using a Scanner and the nextInt() method. Here's my code:</p>
  
  <pre><code>Scanner in = new Scanner(System.in);
      int a;
      int z;
      int x;
  
      System.out.println("Please provide a lower bound (integer): ");
      a = in.nextInt();
  
      System.out.println("Please provide an upper bound (integer): ");
      z = in.nextInt();
  </code></pre>
  
  <p>So now I need to refer back to these user-entered variables in a for-loop that appears later on, but I do not know the syntax to do this. I need the for-loop to start at "a" and continue one-by-one until "z".</p>
  
  <pre><code>for(a ; a &lt;= z ; a++) {
      //code irrelevant to my question
  }
  </code></pre>
  
  <p>Java is making it very clear that I cannot just write the variables in the for-loop, so how do I do it? Thanks!</p>