Mr. 777,

You have a logical error in your post that
'a' is not an object, it is a reference to an object of type A.

You have classes A and B where B is a subclass of A.

In your code, you...