There is no polymorphism on default arguments. They are resolved compile-time.
A::display
has default argument equal 5.
B::display
has default argument equal 9.
It's only the type of a
, aa
, bb
variables that matters.
Use of different default arguments in polymorphic methods is confusing and should be avoided.