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 wonder
With this expression, a[i+1], you are running off the end of the array.
If you must compare to the next element, then stop your iteration 1 element early (and eliminate the semicolon, which Java would interpret as your for loop body):
// stop one loop early ---v v--- Remove semicolon here
for(i = 0; i < a.length - 1; i ++){