As a beginner in Java I have a problem in reversing the array.
This is the code
public class Test {
    public static void main(String[] args) {
        int[] array = new int[] { 10, 20, 30, 40, 50, 60, 70, 80, 90 };
        int x = array.length;
        int[] y = new int[x];
        for (int i = 0; i < x / 2; i++) {
            int temp1 = array[i];
            y[i] = array[x - i - 1];
            array[i] = temp1;
            System.out.println(y[i]);
        }
    }
}
The result must be :
90, 80, 70, 60, 50, 40, 30, 20, 10
But I get only:
90, 80, 70, 60
How do I solve this problem?
Are there any good sources to teach Java?
 
     
    