There are serveral ways to do that. But first, you have to notice that in your code Class A and Class B are not related at all.
In this case, I mean, if your classes are not related, you may want to use composition instead of inheritance. That's to say, you can create a wrapper (or Adpater)...