title: Java: How to reset an arraylist so that it is empty
body: <p>I have an <code>arraylist&lt;interface&gt;</code> 
  Objects get added to this list in a for loop. I would like this arraylist to be empty each time the method is called.</p>
  
  <p>Here is the code:</p>
  
  <p>The array I want to empty here is suggestedPhrases.</p>
  
  <pre><code>public List&lt;Interface&gt; returnSuggestedList(String prefix) {
  
      String tempPrefix = prefix;
  
  
     // suggestedPhrases = null;
      //suggestedPhrases = new ArrayList&lt;Interface&gt;();
      //Vector&lt;String&gt; list = new Vector&lt;String&gt;();
  
      //List&lt;Interface&gt; interfaceList = new ArrayList&lt;Interface&gt;();
      Collections.sort(wordsList);
      System.out.println("Sorted Vector contains : " + wordsList);
      int i = 0;
  
      //List&lt;String&gt; selected = new ArrayList&lt;String&gt;();
      for(String w:wordsList){
          System.out.println(w);
          if(w.startsWith(prefix.toLowerCase())) { // or .contains(), depending on 
              //selected.add(w);     // what you want exactly 
          Item itemInt = new Item(w);
          suggestedPhrases.add(itemInt);
      }
  }
  </code></pre>