title: Why does printing a Java array show a memory location
body: <pre><code>int[] answer= new int[map.size()];  
  HashMap&lt;String, Integer&gt; map = new HashMap&lt;String, Integer&gt;();  
  
  for (int j=0; j&lt;answer.length;j++){  
      int x=map.get(keys.get(j));  
      answer[j]=x;  
  }  
  
  return answer  
  </code></pre>
  
  <p>When I print <code>x</code> using <code>System.out.println(x)</code> in the loop, I get values of <code>1, 2, 3</code> but when I return the answer and print it, I get <code>[I@9826ac5</code>. Any idea why?</p>