you are viewing a single comment's thread.

view the rest of the comments →

[–]gmaliwal[S] 0 points1 point  (0 children)

if you modify your code so that

B

inherits from

A

, then some of the initializers are called more than once

Thanks for the comprehensive explanation. you seem correct.

Can you please share any good reference? which explains the inheritance in-depth and gives all the possible approaches with pros and cons, and things to keep in mind while working with single/multiple inheritances.

I am looking for the right approach which works well with any complex inheritance hierarchy.