title: Importing LinkedList in Java giving an error
body: <p>I have created a class called 'Function' and want to create a LinkedList in it. So I have written the following code (Cropped to the problem area only).</p>
  
  <pre><code>import java.util.LinkedList;
  import java.util.ArrayList;
  
  class Function{
       ArrayList&lt;Integer&gt; arrayList = new ArrayList&lt;Integer&gt;();
       LinkedList&lt;Integer&gt; linkedList = new LinkedList&lt;Integer&gt;();
      protected void addbeg(){
  
  
      }
  }
  </code></pre>
  
  <p>In the import LinkedList line, I am getting the following error: "The <code>import java.util.LinkedList</code> conflicts with a type defined in the same file"</p>
  
  <p>and In the line where I declaring a variable linkedList of type Linked list <code>LinkedList&lt;Integer&gt; linkedlist = new LinkedList&lt;Integer&gt;()</code>, it is giving the follwoing error 'The type LinkedList is not generic; it cannot be parameterized with arguments '</p>
  
  <p>Any help how to eliminate these error? I have seen some tutorial on Java LinkedList where they have written same code without getting any error. I should also mention that The ArrayList is running without any error.</p>