Java:
int [] list = new int [7];
System.out.print(list);
In the console it prints: [I@1f96302
Not only is it giving values other than ints, but it is giving more than I asked it too.
[l@1f96302
is the default way an Object is printed (that's what Object's toString()
method returns for arrays). Try System.out.print(Arrays.toString(list))
instead, which will display the elements of the array.