title: Java override abstract generic method
body: <p><strong>I have the following code</strong></p>
  
  <pre><code>public abstract class Event {
      public void fire(Object... args) {
          // tell the event handler that if there are free resources it should call 
          // doEventStuff(args)
      }
  
      // this is not correct, but I basically want to be able to define a generic 
      // return type and be able to pass generic arguments. (T... args) would also 
      // be ok
      public abstract &lt;T, V&gt; V doEventStuff(T args);
  }
  
  public class A extends Event {
     // This is what I want to do
     @Overide
     public String doEventStuff(String str) {
        if(str == "foo") { 
           return "bar";
        } else {
           return "fail";
        }
     }
  }
  
  somewhere() {
    EventHandler eh = new EventHandler();
    Event a = new A();
    eh.add(a);
    System.out.println(a.fire("foo")); //output is bar
  }
  </code></pre>
  
  <p>However I don't know how to do this, as I cannot override <code>doEventStuff</code> with something specific.</p>
  
  <p>Does anyone know how to do this?</p>