Hi I'm just trying to write a reverse method which will output array values in reverse and I
keep getting this output "a in reverse is [I@19821f"
Here is my code any help would be greatly appreciated:
public static void main(String[] args) {
int[]a={2,4,96};
System.out.print("a in reverse is "+reverse(a));
}
public static int[]reverse(int b[]){
int temp []=new int[b.length];
for(int i=0,j=temp.length-1;i<b.length;i++,j--){
temp[j]=b[i];
}
return temp;
}
}
