The constructor for A
will always run first, even if you are creating a new B
, since B
extends A
.
You have also inadvertently discovered why it's recommended that you don't put virtual function calls in a constructor (at least in .NET).
http://msdn.microsoft.com/en-us/library/ms182331.aspx
"When a virtual method is called, the actual type that executes the method is not selected until run time. When a constructor calls a virtual method, it is possible that the constructor for the instance that invokes the method has not executed."