I'm trying to create and interface of generic type methods, then implement them in a subclass and so on. But I cannot figure out why my subclass throws an error that says I have not overridden the abstract method from my interface. Code is as follows:
package stdmathops1;
public interface StdMathOps1<T>{
public <T> T div(T f, T s);
}
//this is all very simple and not the whole of it, at this point I'm just
//trying to figure out why it won't override the div method.
class Fraction implements StdMathOps1{
public static void main(String[] args){
}
public <T extends StdMathOps1> T div(T f, T s){
return f;
}
}
Wherever I look about overriding and using interfaces it seems right, but it still throws
Fraction is not abstract and does not override abstract method div(Object, Object)
in StdMathOps1
Any help would be greatly appreciated
<T>
while your attempt of overriding specifies a class type that must extend or fall under STDMathOps1