1

I have two async classes in my application which you can see below

class RegisterTokenAsync extends AsyncTask<String, Void, String>

and

class AuthenticateTokenAsync extends AsyncTask<Integer, Void, String>

now I want to create one other Base class and extends this two classes from that base class, but I can't understand how I can do that ?

Viktor Apoyan
  • 10,655
  • 22
  • 85
  • 147

2 Answers2

0

Java(also in android) Doesn't support Multiple inheritance so you cant extend two class.

you can Use Multilevel inheritance.

Like as,,

class A{}

class B extends A{}

class C extends B{}   

Or there are also Interface,that can help....

Samir Mangroliya
  • 39,918
  • 16
  • 117
  • 134
0

Java does not support multiple inheritance. What is it that you wish to abstract to the base class?

Perhaps declaring an interface would help? Then the two classes can implement the same interface.

Dheeraj Vepakomma
  • 26,870
  • 17
  • 81
  • 104