-3

I have an abstract class named Customer and have an MainActivity extends Activity, but how do I extend that Customer abstract class in MainActivity?

ra1ned
  • 337
  • 5
  • 19

1 Answers1

1

In Java, you cannot multiple inherit. Instead of it, you could write:

public class Customer extends Activity{
  ...
}
public class class_name extends Customer{
  ...
}

You could use composition. A code which used composition:

public class class_name{
  private Customer var_name;
  ...
}

For more information: Difference between Inheritance and Composition

Community
  • 1
  • 1
ra1ned
  • 337
  • 5
  • 19