title: Second highest number ArrayList
body: <p>So I got this code so far:</p>
  
  <pre><code>int secondLargest = list.get(0);
  int largest = list.get(0);
  for (int i = 0; i &lt; list.size(); i++)
  {
      if(list.get(i) &gt; largest)
      {
          secondLargest = largest;
          largest = list.get(i);
  
          if(list.get(i) &gt; secondLargest &amp;&amp; list.get(i) != largest)
          {
              secondLargest = list.get(i);
          }
      }
  }
  
  System.out.print("Second biggest number ");
  return secondLargest;       
  </code></pre>
  
  <p>The problem is that when I use this code
  (the list is:)</p>
  
  <pre><code>list2.add(1);
  list2.add(2);
  list2.add(10);
  list2.add(9);
  list2.add(8);
  list2.add(7);
  </code></pre>
  
  <p>the "search" for the second highest number stops at 2, because 10 is the highest number. How do I fix this?</p>