title: Java: Passing an array to println
body: <p>The following is a contrived example I just made up to help me understand the inner workings of java.</p>
  
  <pre><code>public class Main {
  
      public static void main(String[] args) {
          int[] a;
          a = new int[12];
          System.out.println(a);
  
  
      }
  }
  </code></pre>
  
  <p>This prints out some garbage. Since a is passed by reference, I presume <code>println</code> gets the memory address of a, and threats it as a string. I'am right here? Can you elaborate what happens exactly? Thanks. (note: I am not interested in how to print an array. I know that.)</p>