我可以同时使用工具和扩展吗? [英] Can I use implements and extends at the same time?
本文介绍了我可以同时使用工具和扩展吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以同时使用工具和扩展工具吗?因为我在同一个类上使用实现时需要在另一个类上继承某些东西.
Can i use the implements and the extends at the same time? Because I need to inherit something on the other class while i used implements on the same class.
public class DetailActivity extends AppCompatActivity
implementsView.OnClickListener "extends ListActivity"
怎么会这样呢?
推荐答案
是的,但是您需要先编写扩展
实现
:
Yes you can but you need to write your extends
before implements
:
公共类DetailActivity扩展了AppCompatActivity实现的Interface1,Interface2
可以实现任意数量的接口,如果有多个接口,则每个接口都需要用逗号分隔.
Any number of interfaces can be implemented, if more than one then each needs to be separated with a comma.
这篇关于我可以同时使用工具和扩展吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文