my question is when at excatly what time compiler checks and adds this default constructor. And while adding does it check the super class at the same time for a default or a parameterized constructor.
Compiler adds the default constructor if and only if you dont have a parameterized constructor (which implies that in the above example, compiler creates default constructor for Dog and would not create for its super class Animal).
Now since a default constructor has always an implicit call to the default constructor of super class (super()
as its first statement, but as we already concluded, super class (Animal) has no default constructor in our case. So resulting in a compiler error.
Hope it helps.