title: printing values of an array of integers
body: <p>When printing the values within an array of type int. For some reason it keeps printing the last value of list </p>
  
  <pre><code>public class Algorithm {
  
  /**
   * @param args the command line arguments
   */
  int list[] = {10, 9, 8, 7, 6};
  
  
  public void printList(){
  
  for (int x: list ) {
          System.out.print(x);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>public static void main(String[] args) {
  
      Algorithm alg = new Algorithm();
      alg.printList();
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I get 66666. How can I print all the values of the array?</p>