If you must comply with the principle of encapsulation, the interaction will consist only between Aand B. The fact that the implementation Buses inheritance is not related to the code written in A- the only world view is that it calls the method on B.
B A. .