Answers for "how to extends multiple class in java"

2

java multiple extends

//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();
     }
 }
Posted by: Guest on September-01-2021
1

Can a class extend multiple abstract classes

No, java does not support multiple inheritances
Posted by: Guest on November-28-2020

Code answers related to "how to extends multiple class in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language