title: Why print statement calls **toString** method in java?
body: <p>Why the following code segment auto calls <strong>toString()</strong> method?  </p>
  
  <h2>Code:</h2>
  
  <pre><code>public class Demo {
     public Demo() {
      System.out.println(this); // Why does this line automatically calls toString()?
      }
  
     public static void main(String[] args) {
      Demo dm = new Demo();
     }
  }
  </code></pre>