![](/img/trans.png)
[英]how to create generic java class that extends class and implements interface?
[英]Java: how to create a generic class that requires a data type which extends a class and implements an interface?
我想在GWT中創建一個復合,它需要一個擴展類並實現接口的類。 Psudo代碼如下(它顯然不起作用):
class GridRow<T extends Widget implements HasText> extends Composite{
//more codes here
}
這寫成:
class GridRow<T extends Widget & HasText> extends Composite {
// ...
}
你可以有[class or interface]( & [interface])*
(偽正則表達式語言)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.