开发者

Java generics in inheritance in Android

My intention is to set create a class with this type of inheritance:

public class BaseActivity<T> extends <T extends Activity>开发者_开发技巧 

but of course this inheritance syntax doesn't compile. Any alternative suggestion where I can arbitrarily select a Tab or Map Activity to be the base of other Activity classes whose override behavior is necessary?


You can't do that, but you can do:

public class BaseActivity<T extends Activity> extends Activity

That's not exactly what I think you mean to express, but perhaps close?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜