任何人都可以帮助我摆脱这个Exception
?线程“主”java.lang.ArrayIndexOutOfBoundsException异常:10
“在线程异常 ”主“ java.lang.ArrayIndexOutOfBoundsException:10”
import java.util.*;
public class AscendingOrder {
public static void main(String[] args) {
int i, j, temp;
int a[] = {
10, 5, 7, 98, 45, 34, 38, 56, 34, 93
};
for (i = 0; i < a.length; i++) {
for (j = i + 1; j < a.length - 1; j++) {
if (a[i] > a[j]) {
temp = a[i];
a[i] = a[j];
a[j] = temp;
i++;
}
}
}
System.out.println(a[i]);
}
}