9
That's the default implementation of toString() in Object you're seeing. You can use Arrays.toString for a readable result (make sure to import java.util.Arrays):
System.out.println(Arrays.toString(a));
Because currently the toString method from Object class is getting invoked, it looks like this
public String toString() {
return getClass().getName() + "@" + Integer.toHexString(hashCode());
}
Thats why you see [I@1ba4806
You can print array content using Arrays.toString which is overloaded method in Arrays class to print the array.
System.out.println(Arrays.toString(a));
For int[] parameters the method implementation looks like
public static String toString(int[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0; ; i++) {
b.append(a[i]);
if (i == iMax)
return b.append(']').toString();
b.append(", ");
}
}