public class Array02 {
public static void main(String[] args) {
int[] arrge = {1, 2, 3, 4, 5};
for (int min = 0, max = arrge.length - 1; min <= max; min++, max--) {
int temp = arrge[min];
arrge[min] = arrge[max];
arrge[max] = temp;
}
for (int i = 0; i < arrge.length; i++) {
System.out.print(arrge[i]);
}
}
} |
|