title: Overriding a method contract in an extended interface that uses generics (Java)?
body: <p>I am attempting to override a method declaration within an interface that extends another interface. Both of these interfaces use generics. According to the Java tutorials, this should be possible, but the example does not use generics. When I try to implement it, the compiler shows the following error (I've replaced names because some of the code is not my own.): </p>
  
  <blockquote>
    <p>myMethod(T) in InterfaceExtended
    clashes with myMethod(T) in Interface;
    both methods have the same erasure,
    but neither overrides the other.</p>
  </blockquote>
  
  <p>Code looks like this:</p>
  
  <pre><code>public interface Interface&lt;T&gt;
  {
  public void myMethod(T x);
  }
  
  public interface ExtendedInterface&lt;T&gt; extends Interface&lt;T&gt;
  {
  public void myMethod(T x);
  }
  </code></pre>
  
  <p>If anyone has suggestions as to how to alter this to make it acceptable, or an explanation regarding the reason this is causing a problem, I would very much appreciate it.</p>
  
  <p>Thanks!</p>
  
  <p>badPanda</p>