My code is returning gibberish(at least for me) and I don't know how to get it to work.
I've tried some different return configurations but none of them work the way I want it to.
class Main {
public static void main(String[] args) {
int[] reversing= {1,5,3,14,5,26,7,8,9,10,928,0};
System.out.println(reverse(reversing));
}
public static int[] reverse(int[] nums){
for(int i=0;i<nums.length;i++){
nums[i]=nums[nums.length-1];
}
return nums;
}
}
The code is supposed to take an array of integers and reverse the numbers but instead it simply returns [I@5acf9800