title: min- and max value of an array in Java
body: <p>I'm trying to get the minimum and maximum value of an array. The problem is that I'm not sure what exactly happens in the <code>for loop</code>. We create a <code>for loop</code> with an <code>int</code>. Then comes the if statement and also my question: <strong>What should <code>numbers[i]</code> mean?</strong> I thought that <code>numbers</code> already has specified size (9, by initializing <strong>{ 1,2,3,...,9}</strong>). How can we change that to <code>[i]</code> and what does that i stand for?</p>
  
  <pre><code>public class Array {
  
  public static void main(String[] args) {
      int numbers[] = { 92, -108, 2, 120, 67, 4, -81, 9, 88, 1 };
      int min, max;
      min = max = numbers[0];
  
      for (int i = 1; i &lt; 10; i++) {
          if (numbers[i] &lt; min)
              min = numbers[i];
          if(numbers[i] &gt; max){
              max = numbers[i];
          }
      }
      System.out.println("min is: " + min + "; max is: " + max);
  }
  }
  </code></pre>
  
  <p>Looking forward to your replies</p>