title: How to get the total length of all strings in an ArrayList<String>?
body: <p>If I use an example for this question, it is very simple to understand:</p>
  
  <pre><code>ArrayList&lt;String&gt; array;
  String str = toString(array);
  
  String toString(ArrayList&lt;String&gt; array) {
      StringBuilder sb = new StringBuilder();
      for( String string : array ) {
          sb.append(string);
      }
      return sb.toString();
  }
  </code></pre>
  
  <p>The question is:
  How to get <code>str</code>'s length efficiently without converting the <code>array</code> to string explicitly?</p>