title: Error while running a Java program
body: <p>I was trying to convert an array to a list and vice-versa and perform different methods of array and list respectively using the below code.</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>import java.util.*;
  
  public class LinkedList{
  
      public static void main(String[] args){
          String[] things1 = {" seminar", " presentations", " hackathon", " movies"};
          LinkedList&lt;String&gt; theList = new LinkedList&lt;String&gt;(Arrays.asList(things1));
  
          theList.add("tickets");
          theList.addFirst("Hellow");
  
          things1 = theList.toArray(new String[theList.size()]);
  
          for(String x: things1)
              System.out.printf("%s", x);
      }
  }
  </code></pre>
  
  <p>Now, the problem is that when I am running it from NetBeans it works correctly, but when I am trying it in normal text editor and running through terminal it gives an error:</p>
  
  <pre class="lang-java prettyprint-override"><code>LinkedList.java:10: error: type LinkedList does not take parameters
  LinkedList&lt;String&gt; theList = new LinkedList&lt;String&gt;(Arrays.asList(things1));
            ^
  LinkedList.java:10: error: type LinkedList does not take parameters
  LinkedList&lt;String&gt; theList = new LinkedList&lt;String&gt;(Arrays.asList(things1));
                                             ^
  2 errors
  </code></pre>
  
  <p>I think the list should take parameter but the error is completely opposite.</p>
  
  <p>Why is it so?</p>