In my interface:
public Result query(T query)
In my 1st subclass:
public Result query(HashMap que
It thinks you're trying to create a type parameter -- a variable -- whose name is String
. I suspect your first subclass simply doesn't import java.util.HashMap
.
In any event, if T
is a type parameter of your interface -- which it probably should be -- then you shouldn't be including the <String>
in the subclasses at all. It should just be
public interface Interface<T> {
public Result query(T query);
}
public class Subclass implements Interface<String> {
...
public Result query(String queryStr) {
...
}
}