title: Comparing multiple integers in IF statement, Java
body: <p>I am brand new to coding. I'm currently using "Java:How to program" by Deitel, and one of the early exercises has me stumped.</p>
  
  <p>It is asking me to use simple, chapter 1 if statements to compare 5 integers (input by the user) and display both the largest and the smallest. I am limited to the language used in the first chapter, so I made the assumption that I could list int values in the parenthetical after the if statement. Something like:</p>
  
  <pre><code>int firstInt;
  int secondInt;
  int thirdInt;
  int fourthInt;
  int fifthInt;
  
  if (first Int&gt; secondIt, thirdInt, fourthInt, fifthInt)
  </code></pre>
  
  <p>etc. but this is a syntax error. Does anyone know how to compare multiple values simultaneously? A google search proves to be no help since all the answers have some convoluted solution that I don't understand. </p>
  
  <p>If I try something like this:</p>
  
  <pre><code>     if (one &gt; two)
       System.out.println("%d is the largest number!", one);
  
       if (one &gt; three)
  </code></pre>
  
  <p>etc. for all 1 - 5, The issue I run into is when I continue with if statements 1>2,3,4,5 2>1,3,4,5 etc. then there will be 1 true for each integer regardless except for the smallest number, and it will display 4 outputs, when all I'm after is the larges and the smallest.</p>
  
  <p>I'm stumped.</p>