title: Check if an array is sorted, return true or false
body: <p>I am writing an easy program the just returns true if an array is sorted else false and I keep getting an exception in eclipse and I just can't figure out why. I was wondering if someone could take a look at my code and kind of explain why I'm getting an array out of bounds exception.</p>
  
  <pre><code>public static boolean isSorted(int[] a) 
  {
      int i;
      for(i = 0; i &lt; a.length; i ++);{
          if (a[i] &lt; a[i+1]) {
              return true;
          } else {
              return false;   
          }
      }
  }
  public static void main(String[] args)
  {
      int ar[] = {3,5,6,7};
      System.out.println(isSorted(ar));   
  }
  </code></pre>