please give me some advice...is there something wrong?
package en.codegym.task.pro.task06.task0605;
/*
Correct order
*/
public class Solution {
public static void main(String[] args) {
int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
printArray(array);
reverseArray(array);
printArray(array);
}
public static void reverseArray(int[] array) {
//write your code here
for(int y=0;y<10;y++) {
int temp= array[y] ;
array[y]= array[(array.length-1)-y];
temp =array[(array.length-1)-y] ;
System.out.print(temp+ ", ");
}
System.out.println();
}
public static void printArray(int[] array) {
for (int i : array) {
System.out.print(i + ", ");
}
System.out.println();
}
}