Java: an alternative to multiple inheritance

I have a class A that needs to extend classes B and C, which are both provided by a third party, and I do not control them. Because Java does not support multiple inheritance. Using the interface would not help in my case, since I want to inherit the implementation of the base classes, and I do not want to copy their code into my class, or I need to know all their coming changes.

What would be the best way to accomplish this task?

All suggestions will be highly appreciated!

0
java inheritance interface abstract-class multiple-inheritance
source share
1 answer
class A class B2 extends B inherit B stuff class C2 extends C inherit C stuff B2 b2 = new B2(); C2 c2 = new C2(); // or use anonymous classes A has access to everything in B2 and C2, therefore A has access to B and C inheritable assets. 
+1
source share

All Articles