title: Converting ArrayList <T> to String[] does not take correct elements to put into the String[]
body: <p>I have a method in a program that takes an ArrayList objects:</p>
  
  <pre><code>private ArrayList&lt;T&gt; list;
  </code></pre>
  
  <p>and subsequently can use this method to take all of the items, copy them to a String Array, and then remove the items from the original list.</p>
  
  <p>Here is the method:</p>
  
  <pre><code>public String[] takeAll()
  {
      if (this.list.size() &lt;= 0)
      {
          throw new NoSuchElementException("Unable to take elements from empty array list");
      }//checks if list is empty
  
      String[] targetArray;
      targetArray = list.toArray(new String[list.size()]); //adds the Objects to the String[] targetArray
  
      list.clear();
  
      return targetArray;
  }
  </code></pre>
  
  <p>Main that tests this:</p>
  
  <pre><code>    public static void main(String args[])
  {
      SimpleList a;
      a = new SimpleList(Position.FIRST, Position.LAST);
      String[] b;
      a.list.add("thing1");
      a.list.add("thing2");
      a.list.add("thing3");
      a.list.add("thing4");
      b = a.takeAll();
      System.out.println("The String Array b contains: " + b);
  }
  </code></pre>
  
  <p>When I run it, it returns something odd:</p>
  
  <p>The String Array b contains: [Ljava.lang.String;@15db9742</p>
  
  <p>What would I have to change to actually print out b where it should display {"thing1", "thing2", "thing3", "thing4"} ?</p>