Multiple choice

What will be the order of execution of class constructors in following code? class alpha{ - - -}; class beta { - - -}; class gamma: public beta, public alpha{- - -};

  1. beta, alpha, gamma

  2. alpha, gamma , beta

  3. gamma , beta, alpha

  4. all of the above

  5. none of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Beta is initialized first because it has been declared first in the derived class header line. Then alpha and lastly the derived class.