What is the order of execution of Static , Initializer and Constructor in a class with a parent class eg: Class A extends Class B

Always remember the rule – “SIC” – Static, Initializer and then Constructor.

  1.  Parent class is loaded first
  2.  Static block of Parent
  3. Child class is loaded 
  4. Static variables/block of Child
  5. Initializer of Parent
  6. Constructor of Parent
  7.  Initializer of Child
  8. Constructor of Child