title: how to convert arraylist into string?
body: <p>I am beginner in java. In my code i have a arraylist and i want to output completely as a String. for this i have write this code.</p>
  
  <pre><code>package factorytest;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class MatchingWord {
  
      public static void main(String[] args) {
  
          List &lt;String&gt; myList = new ArrayList&lt;String&gt;();
          myList.add("hello");
          myList.add("first");
          myList.add("second");
          myList.add("third");
          myList.add("fourth");
  
          // 1st approach
          String listString = "";
  
          for (String s : myList)
          {
              listString += s + "\t";
          }
  System.out.println(listString);
      }
  
  }
  </code></pre>
  
  <p><strong>and my output is</strong></p>
  
  <pre><code>hello   first   second  third   fourth  
  </code></pre>
  
  <p>i don't want the last \t after the last element. how can i achieve this.</p>