I have couple of supplied interfaces
public interface Finder,T extends Item> {
public S find(S s, int a);
}
public interf
public class SimpleFinder,T extends Item> implements Finder{
public S find(S s, int a){
Stack stack = ....;
...
stack = s.getCopy();
.....
return (S) stack;
}
}
should work. Keep in mind that stack must be a Stack
and not S
to match getCopy() return type. I would expect S
type to be Ok, since it extends Stack
, but implementing it this is the behavior that I'm observing.