I am trying to override a method declaration in 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 replaced the names because part of the code is not mine.):
myMethod (T) in InterfaceExtended collision with myMethod (T) in interface; both methods have the same erase, but do not override the other.
The code is as follows:
public interface Interface<T>
{
public void myMethod(T x);
}
public interface ExtendedInterface<T> extends Interface<T>
{
public void myMethod(T x);
}
If anyone has suggestions on how to change this to make it acceptable, or an explanation of why this is causing the problem, I would really appreciate it.
Thank!
badPanda