title: Generic type <E> in Java
body: <p>I'm trying to make an implementation of the Java queue class but I have some problems.</p>
  
  <p>I want the class to implement the following interface:</p>
  
  <pre><code> public interface iQueue&lt;E&gt; {
       public void add(E e); 
   }
  
   public class Queue&lt;E&gt; implements iQueue{
  
       Element&lt;E&gt; first;
  
       @Override
       public void add(E e) {
           Element&lt;E&gt; node = new Element();
           node.setData(e);
       }
   }
  </code></pre>
  
  <p>The compiler indicates that the add method parameter must be of type Object to implement the interface</p>
  
  <p>If I declare the parameter of type Object, is the type E declared when constructing the class respected?
  Thank you very much</p>