开发者

How to declare class that extends generic that extends generic

I have a class that extends generic class that also extends (another) generic class.

class B<TypeB> extends C{}
class C<TypeC>{}

and now my probl开发者_StackOverflow社区ems is how to specify the TypeC when creating class A should be something like:

class A extends B<Type1><C<Type2>>

but the above actually does not compile.


Your decl of B should be:

class B<TB, TC> extends C<TC> {
}

and your target will be

class A extends B<ConcreteB, ConcreteC> {
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜