Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an activity have two implements?

Can I implement OnClickListener and SurfaceHolder like this :

    public class MainActivity extends Activity implements SurfaceHolder.Callback,OnClickListener
like image 856
Ahmad Jouni Avatar asked Jul 06 '13 21:07

Ahmad Jouni


1 Answers

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.

like image 61
francoisr Avatar answered Sep 23 '22 13:09

francoisr