public static void main(String[] args) {
int [] a={1,12,35,78};
reverseOrder(a);
public static void reverseOrder(int [] a){
for(int i=0;i<(a.length) /2 ;i++){
int temp=a[i];
a[i]=a[a.length-1-i];
a[a.length-1-i]=temp;
}
for(int i=0;i<a.length ;i++){
System.out.println(a[i]);
}
}
} |
|