title: Java Generics Name Clash when Extending
body: <p>I am new to generics and I would appreciate any help I can get with the following problem:</p>
  
  <p>I have this parent class:</p>
  
  <pre><code>public class Parent&lt;K, V&gt; {
       public void f(K key,V value){}
  }
  </code></pre>
  
  <p>And then I have this child class:</p>
  
  <pre><code>public class Child&lt;K,V&gt; extends Parent&lt;K,LinkedList&lt;V&gt;&gt; {
       @Override
       public void f(K key,V value) {}
  }
  </code></pre>
  
  <p>Well, the hope was that <code>Child.f</code> would override <code>Parent.f</code>, but unfortunately the compiler doesn't like what is going on here and gives me: </p>
  
  <p><code>Name clash: The method f(K, V) of type Child&lt;K,V&gt; has the same erasure as f(K, V) of type 
   Parent&lt;K,V&gt; but does not override it</code></p>
  
  <p>I have seen this error before in different contexts, but I am not sure why it comes up in this particular one. Is there any way of avoiding it?</p>
  
  <p>Thanks in advance.</p>