Printing all elements of an array in one println statement in Java [duplicate]
问题 This question already has answers here : What's the simplest way to print a Java array? (32 answers) Closed last month . public class Test { public static void main(String[] args) { int[] a= new int[]{1,2,3}; System.out.println(a); } } I expected to take a compile or run-time error.I took an output.It's " [I@1ba4806 ".What's the reason of it in Java? 回答1: That's the default implementation of toString() in Object you're seeing. You can use Arrays.toString for a readable result (make sure to