How do (can?) I write a class that extends a class and a subclass
<p>I have a question that I am not sure has an answer, but its worth a shot because I would like to not have to maintain two copies of code.</p>

<p>I have a library where class B is a subclass of class A. I have written myself a class C, which extends class A. I would like to make it so that B extends C rather than A, however because A and B are 3rd party libraries for which I do not have source, I do not know how to do this.</p>

<p>Currently, the only solution I know is to make a copy of my class C as a class D, and have it extend B, then refer to D rather than B in my code.</p>

<p>I guess in other words, I am trying to extend a superclass, that then propagates to subclasses.</p>

<p>I hope this post is coherent enough.</p>

<p>Thanks!</p>
