Given an array, , of integers, print 's elements in reverse order as a single line of space-separated numbers. Example Print 4 3 2 1. Each integer is separated by one space.
Example: Given an array, A, of integers, print N's elements in reverse order as a single line of space-separated numbers.
static int[] reverseArray(int[] array) {
int end = array.length-1;
for(int i=end; i>=0; i--) {
a[i] = a[i] + " ";
}
return String.valueOf(a);
}