title: (Java) Check array for increasing elements
body: <p>I'm attempting to create a method that checks an array for increasing elements. True should be returned if all the elements are in increasing order. I get an out-of-bounds exception when I compare arr[i+1]. Any ideas on how I can make it work. </p>
  
  <pre><code>int[] one = {1,2,3,4,5};
  
  public static boolean isIncreasing(int[]arr)
  {
      boolean z = false;
  
      for(int i=0; i&lt;arr.length;i++)
      {
  
          if(arr[i]&lt;arr[i+1])
              {
                  z = true;
              }
      }
  
      return z;
  }
  </code></pre>