title: Java array , print what is stored in the array
body: <p>How do I print what is stored in the array in an easy way. I have been staring at this for the past 3 hours!</p>
  
  <pre><code>import java.util.Scanner;
  
  public class December2012 {
  
      public static void main(String[] args) {
  
          int[] array = new int[100];
          int sum = 0;
          int i = 0;
          Scanner input = new Scanner(System.in);
          while (sum &lt;= 100 &amp;&amp; i &lt; array.length) {
              System.out.print("Write in the " + (i + 1) + "th number: ");
              array[i] = input.nextInt();
              sum += array[i];
              i++;
  
          }
          System.out.print("You added: ");
          System.out.print(array[i] + " ");
  
          System.out.println("\nsum is " + sum);
      }
  }
  </code></pre>