title: How can I support println in a class?
body: <p>What does my own made class need to support in order for <code>println()</code> to print it? For example, I have:</p>
  
  <pre><code>public class A {
  ...
  }
  </code></pre>
  
  <p>What methods should class <code>A</code> have to make this code work? Maybe something like this:</p>
  
  <pre><code>public static void main() {
      A a = new A();
      System.out.println(a);
  }
  </code></pre>
  
  <p>I have a guess that the <code>toString()</code> method must be overloaded. Am I right? Is this enough?</p>