title: Java generic method inheritance and override rules
body: <p>I have an abstract class that has a generic method and I want to override the generic method by substituting specific types for the generic parameter. So in pseudo-code I have the following:</p>
  
  <pre><code>public abstract class GetAndParse {
    public SomeClass var;
  
    public abstract &lt;T extends AnotherClass&gt; void getAndParse(T... args);
  }
  
  public class Implementor extends GetAndParse {
    // some field declarations
  
    // some method declarations
  
    @Override
    public &lt;SpecificClass&gt; void getAndParse(SpecificClass... args) {
      // method body making use of args
    }
  }
  </code></pre>
  
  <p>But for some reason I'm not allowed to do this? Am I making some kind of syntax error or is this kind of inheritance and overriding not allowed? Specifically I'm getting an error about <code>@Override</code> because the eclipse IDE keeps reminding me to implement <code>getAndParse</code>.</p>
  
  <p>Here's how I want the above code to work. Somewhere else in my code there is a method that expects instances of objects that implement <code>GetAndParse</code> which specifically means that they have a <code>getAndParse</code> method that I can use. When I call <code>getAndParse</code> on that instance the compiler checks to see whether I have used specific instances of <code>T</code> in the proper way, so in particular <code>T</code> should extend <code>AnotherClass</code> and it should be <code>SpecificClass</code>.</p>