public static void main(String[] args) {
int[] a = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int len = a.length;
int temp;
for (int i = 0; i < len; i++) {
for (int j = 0; j < len - i - 1; j++) {
if (a[j] < a[j + 1]) {
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
System.out.println("数组中的最小值为:" + a[0] + " ,最大值为:" + a[len - 1]);
}