title: Taking average of user input number
body: <p>This is my code</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  
  public class eCheck10A
  {
  public static void main(String[] args)
  {
    PrintStream out = System.out;
    Scanner in = new Scanner(System.in);
  
    out.print("Enter your integers");
    out.println("Negative = sentinel");
  
    List&lt;Integer&gt; aList = new ArrayList&lt;Integer&gt;();
  
  
  
    for (int n1 = in.nextInt(); n1 &gt; 0; n1 = in.nextInt())
    {
            if(n1 &lt; 0)
            {
            break;
            }
    }
  
  
   }
  }
  </code></pre>
  
  <p>if i want to take all the numbers that I enter for n1, and average them out, how do i refer to all these numbers? I am going to put them in the IF statement, so if a negative number is entered, the program stops and posts their average.</p>