title: Printing value at array index returns hashcode
body: <p>Just playing around with displaying values in a two dimensional array and noticed my code prints some <code>hashcodes</code> and then the values. But I am not printing the array object itself (as done in the post <a href="https://stackoverflow.com/questions/4479683/java-arrays-printing-out-weird-numbers-and-text">here</a>) or at least explicitly calling the <code>toString</code> or <code>hashcode</code> method of the array object. Instead, I'm directly accessing and printing the values in the array using <code>arrayObj[i]</code> and <code>arrayObj[i][j]</code>.</p>
  <p>Here's my code:</p>
  <pre><code>class PrintTwoDimArray {
      public int [][] createArray () {
          int counter = 0;
          int[][] intArray = new int [2][4];
          for (int i = 0; i &lt; intArray.length; i++) {
              for (int j = 0; j &lt; intArray[i].length; j++) {
                  intArray[i][j] = ++counter;
              }
          }
          return intArray;
      }
      public void printArray ( int [][] arrayObj ) {
          for (int i = 0; i &lt; arrayObj.length; i++) {
              System.out.print(arrayObj[i] + &quot; &quot;);
              for (int j = 0; j &lt; arrayObj[i].length; j++) {
                  System.out.print(arrayObj[i][j] + &quot; &quot;);
          }
          System.out.println();
          }
      }
  }
  
  class TestPrintTwoDimArray {
      public static void main (String[] args) {
      
      PrintTwoDimArray twoDim = new PrintTwoDimArray();
      int [][] multiArray = new int [2][4];
      multiArray = twoDim.createArray();
      twoDim.printArray(multiArray);
      }
  }
  </code></pre>
  <p>My output is as follows:</p>
  <p><img src="https://i.stack.imgur.com/EzCSY.png" alt="enter image description here" /></p>
  <p>It seems that my code is somehow calling the <code>toString</code> or <code>hashcode</code> method of the array. Thoughts? How can I modify to print just the values?</p>
  <p><strong>javac and java version 1.8.0</strong></p>