I have the following interface:
public interface SingleRecordInterface<T> {
public void insert(T object);
}
I have the abstract class below (that does not mention the method insert):
public abstract class AbstractEntry implements SingleRecordInterface<AbstractEntryBean> {
}
I have the concrete class:
public class SpecificEntry extends AbstractEntry {
public void insert(SpecificEntryBean entry) {
// stuff
}
}
Finally, SpecificEntryBean is defined as:
public class SpecificEntryBean extends AbstractEntryBean {
}
I have the following error:
The type SpecificEntry must implement the inherited abstract method SingleRecordInterface.insert(AbstractEntryBean)
I don’t understand the reason for this error, given that SpecificEntryBean extends AbstractEntryBean. How do I fix this error?
You need to make your abstract class generic as well:
Then for your concrete class: