Generics: Inheriting from an abstract class that implements an interface

前端 未结 4 1335
臣服心动
臣服心动 2020-12-29 05:31

I have the following interface:

public interface SingleRecordInterface {
    public void insert(T object);
}

I have the abstract c

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 06:11

    Change to the following:

    public abstract class AbstractEntry implements SingleRecordInterface {
    }
    

    and

    public class SpecificEntry extends AbstractEntry {
        public void insert(SpecificEntryBean entry) {
            // stuff
        }
    }
    

提交回复
热议问题