title: What happens when we pass an argument to System.out.println()?
body: <p>I'm a beginner and I am not able to understand how println() function actually works. When I pass primitive variable to it . It prints value of it. When I pass an object why does it print default toString() method definition? i.e.  </p>
  
  <pre><code> getClass().getName() + '@' + Integer.toHexString(hashCode()) 
  </code></pre>
  
  <p>So when I am trying to print out an array.</p>
  
  <pre><code> System.out.println(Arrays.toString(array))
  </code></pre>
  
  <p>Am I overriding default method definition of toString of Object class or just converting Array to String using toString() method of Arrays class.</p>
  
  <pre><code>import java.util.Arrays;
  
  
  public class RevString 
  {
      public static void main(String[] args)
      {
          String str = "abcde";
          int x=2;
          String[] e =str.split("---");
          System.out.println(e);
          System.out.println(Arrays.toString(e)+ " " +"Primitive is " + " " + x);
  
      }
  
  }
  </code></pre>