title: How to convert ArrayList of Strings to char array
body: <p>The following code converts <code>ArrayList&lt;String&gt;</code> to <code>char[]</code> and print output which appears as <code>[back, pack]</code>. Here, the <code>char[]</code> includes <code>','</code> and <code>' '</code>. Is there a way to do it in another way to get rid of comma and space?</p>
  
  <pre><code>ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
  list.add("back");
  list.add("pack");
  
  char[] chars = list.toString().toCharArray();
  
  for (char i : chars){
     System.out.print(i);
  }
  </code></pre>