I very well know that it can be done with the help of interfaces and i have done it many times. But this time my situation is quite difference. I have class A
, class B
and i need to create another class C
which extends both A and B because C should have boths functionality and also note that A and B are not inter related so even i cant say A may extend class B
.
I am quite confused what should i do right now. I know we cant change java... but at least there would be some way possible. Even the nearest may also do... please help me out.
Adding more details:- Class B
is a standard API while class A
is a common exception class that need to be inherited by all exception classes.
Related question:
- Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed? (though my question above is not about why it's not allowed.)