title: Java: find the largest number in a list of a number of integers that the user has set
body: <p>the code below compiles perfectly for 5 integers entered by the user.
  <br>what i want to do is alter my code so that i can as the user how many numbers the user wants in the list. then the program will ask the user to enter that many integers and then the program will find the largest of those integers. can anyone help me alter the code below to fit these new standards?</p>
  
  <pre><code>{
      int integer1 = 
      Integer.parseInt(JOptionPane.showInputDialog( "Enter an integer:" ));
      int integer2 = 
      Integer.parseInt(JOptionPane.showInputDialog( "Enter an integer:" ));
      int integer3 = 
      Integer.parseInt(JOptionPane.showInputDialog( "Enter an integer:" ));
      int integer4 = 
      Integer.parseInt(JOptionPane.showInputDialog( "Enter an integer:" ));
      int integer5 = 
      Integer.parseInt(JOptionPane.showInputDialog( "Enter an integer:" ));   
  
      if (integer1 &gt; integer2 &amp;&amp; integer1 &gt; integer3 &amp;&amp; integer1 &gt; integer4 &amp;&amp; integer1 &gt; integer5)
          JOptionPane.showMessageDialog(null, "The largest number is: " + integer1);
      if (integer2 &gt; integer1 &amp;&amp; integer2 &gt; integer3 &amp;&amp; integer2 &gt; integer4 &amp;&amp; integer2 &gt; integer5)
          JOptionPane.showMessageDialog(null, "The largest number is: " + integer2);
      if (integer3 &gt; integer2 &amp;&amp; integer3 &gt; integer1 &amp;&amp; integer3 &gt; integer4 &amp;&amp; integer3 &gt; integer5)
          JOptionPane.showMessageDialog(null, "The largest number is: " + integer3);
      if (integer4 &gt; integer1 &amp;&amp; integer4 &gt; integer3 &amp;&amp; integer4 &gt; integer2 &amp;&amp; integer4 &gt; integer5)
          JOptionPane.showMessageDialog(null, "The largest number is: " + integer4);
      if (integer5 &gt; integer1 &amp;&amp; integer5 &gt; integer3 &amp;&amp; integer5 &gt; integer4 &amp;&amp; integer5 &gt; integer2)
          JOptionPane.showMessageDialog(null, "The largest number is: " + integer5);
   }
  </code></pre>
  
  <p>i first want to prompt the user with </p>
  
  <pre><code>how many integers do you want in your list?
  </code></pre>
  
  <p>then i want to say</p>
  
  <pre><code>enter an integer: 
  </code></pre>
  
  <p>as many times as the user said he wanted.</p>