public static void main(String[] args) {
int[] arr1;
arr1 = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
for (int i = 0; i < arr1.length; i++) {
for (int j = arr1.length - 1; j >= 0; j--) {
arr1[i] = arr1[j];
break;
}
}
for (int i = 0; i < arr1.length; i++) {
System.out.println(arr1[i]);
}
}
全部评论
(3) 回帖