Redundant generic parameters

后端 未结 6 1919
没有蜡笔的小新
没有蜡笔的小新 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:08

    Why you cannot remove second K from,

    public interface GenericRepository, K> {
    

    So rather than having it as above, can we have it as

    public interface GenericRepository> {
    

    By this we can do what you want to do.

提交回复
热议问题