title: Java overloading toString() method when array of class is given
body: <p>This is how you overload the <code>toString()</code> method:</p>
  
  <pre><code>public class Person extends Object {
      @Override
      public final String toString() {
          Gson gson = new GsonBuilder().serializeNulls().create();
          return (gson.toJson(this));
      }
  }
  </code></pre>
  
  <p>In this example I get a JSON string when calling the <code>toString()</code> method of <code>Person</code> instead of the default string representation of an <code>Object</code>.</p>
  
  <p>But what if I have an array of <code>Person</code> like:</p>
  
  <pre><code>Person[] persons = new Person[3];
  System.out.println(persons.toString());
  </code></pre>
  
  <p>What do I have to do or which method(s) do I have to override in that case?</p>