java multiple extends

Solutions on MaxInterview for java multiple extends by the best coders in the world

showing results for - "java multiple extends"
Clayton
03 Sep 2017
1//You can only Extend a single class. And implement Interfaces from many sources.
2
3public class CustomActivity extends Activity {
4
5     private AnotherClass mClass;
6
7     protected void onCreate(Bundle savedInstanceState) {
8         super.onCreate(savedInstanceState);
9         mClass = new AnotherClass(this);
10     }
11
12     //Implement each method you want to use.
13     public String getInfoFromOtherClass()
14     {
15        return mClass.getInfoFromOtherClass();
16     }
17 }
18