Use Arrays.toString()
(don't forget to import java.util.Arrays
):
System.out.print(Arrays.toString(a));
Arrays don't override toString()
(the method that gets called when you try to print an object), so the implementation defaults to that of Object
which consists of the class name followed by the hash code.