问题
Can I implement OnClickListener
and SurfaceHolder
like this :
public class MainActivity extends Activity implements SurfaceHolder.Callback,OnClickListener
回答1:
Yes, in Java a class can implement many different interfaces.
This compensates the lack of multiple inheritance in Java, as opposed to e.g. C++ where multiple inheritance is allowed.
来源:https://stackoverflow.com/questions/17507225/can-an-activity-have-two-implements