import java.util.Arrays;
public class Main {
public static void main(String[] args) {
int[] numbers = {1, 2, 3, 4, 5};
reverse(numbers);
System.out.println("Reversed array = " + Arrays.toString(numbers));
}
public static void reverse(int[] array) {
int halfLength = array.length / 2;
for (int i = 0; i < halfLength; i++) {
int temp = array[i];
array[i] = array[array.length - 1 - i];
array[array.length -1 - i] = temp;
}
}
}