문제

I would like to correctly extend an interface but since is uses generics, I became a bit confused. Here is the first interface

public interface A<T extends Resource>{
 ...
}

I would like to write something like this but it does not work.

public interface B<T extends Resource> extends A<T extends Resource> 
{
 ...
}

I do not understand why this does not work. Could you explain?

도움이 되었습니까?

해결책

Since you have already defined the type T, it should be:

public interface B<T extends Resource> extends A<T> {

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top