This question has already been answered:
- Using the toString method on arrays 2 responses
There is a code. Eclipse does not produce errors. However, at compilation, abracadabra is displayed, but in the debugger (inside) everything is ok. What's wrong? Thank you in advance!
package arrays; //Returning an Array from a Method public class TestArrays4 { public static int[] reverse(int[] list) { int[] result = new int[list.length]; for (int i = 0, j = result.length - 1; i < list.length; i++, j--){ result[j] = list[i]; } return result; } public static void main(String[] args) { int[] a = {1, 2, 3}; int[] c = reverse(a); System.out.println("hi " + c); } } in console
hi [I@1db9742