title: Checking if Strings in an Array are in Alphabetical Order
body: <p>I'm checking if the strings in my array are arranged in alphabetical order. My codechecker is saying that my code fails to account for some cases, but I'm really not sure how to change it.</p>
  
  <p>EDIT: Apparently my code returns "true" when checking the array "cat ape dog zebra", which is clearly false.    </p>
  
  <pre><code>public boolean isSorted()
  {
      boolean sorted = true;                          
      for(int i = 0; i &lt; list.size(); i++)
      {
          for(int j = i+1; j &lt; list.size(); j++) 
          {
              if (list.get(i).compareTo(list.get(j)) == 1)
              {
                  sorted = false;
              }  
          }  
      }                
      return sorted;
  }
  </code></pre>