Redundant generic parameters

后端 未结 6 1872
没有蜡笔的小新
没有蜡笔的小新 2021-01-12 03:36

I have this two interfaces and classes:

public interface Identifiable {
    T getId();
}

public interface GenericRepository

        
6条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 04:32

    It would work with (i.e. compile)

    public interface GenericRepository {
        T get(T id);
    }
    

    but it says nonetheless that Identifiable is a raw type and that it should be parametrized.

    Hope it helps.

提交回复
热议问题