Reputation: 23
I want to-->
class mainactivity extends ListActivity,MapActivity{ }
It's possible???
class mainactivity extends Any java class1,Any java Class2{ }
anyone possible??
Upvotes: 4
Views: 15953
Reputation: 18489
No it's not possible because you can not extend more than one class but you can implement more than one interface which is not of any use here.
Upvotes: 3
Reputation: 1039
Java does not support multiple inheritance, more than one class can not be extended but there is solution , but in your case i think you can use like this:
class MapActivity extends Service{
...
}
class mainactivity extends ListActivity{
MapActivity mapActivity= new MapActivity();
}
Upvotes: 2
Reputation: 7639
no its not possible because in core java a class can only inherit one class . In c++ its possible to inherit more than one class. So thats why its not possible
Upvotes: 2