📜  java 多重扩展 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:30.783000             🧑  作者: Mango

代码示例1
//You can only Extend a single class. And implement Interfaces from many sources.

public class CustomActivity extends Activity {

     private AnotherClass mClass;

     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         mClass = new AnotherClass(this);
     }

     //Implement each method you want to use.
     public String getInfoFromOtherClass()
     {
        return mClass.getInfoFromOtherClass();
     }
 }