title: Printing arrays: memory address or its content?
body: <p>Can you explain why this code</p>
  
  <pre><code>int[] test={0,0,0,0,0};
  System.out.println(test);
  </code></pre>
  
  <p>prints something like [I@42e816 (perhaps memory address) but this code</p>
  
  <pre><code> Stack&lt;Integer&gt; stack = new Stack&lt;Integer&gt;();
   stack.push(1);
   stack.push(3);
   stack.push(5);
   stack.push(2);
   stack.push(4);
   System.out.println(stack);
  </code></pre>
  
  <p>prints "[1, 3, 5, 2, 4]"? What's the difference? </p>
  
  <p>If Stacks derive from Vectors and Vectors from arrays, what's the cause of this different behavior?</p>