This has to do with forward referencing and not necessarly inheritance.
Basically, when a new Square object is created, the superclass object (Shape) is created and initialized. When the initialization of the Shape object occurs, the instance member "area" is initialized with the value returned by the getArea method. Since getArea is overridden in Square, it is invoked and returns the
current value of the area instance member of the Square class which still has a default value of 0 since the Square class has not been initialized yet. That's why the area instance variable of the Shape class has the value 0.
Please check out
JLS 8.3.2.3 Restrictions on the use of Fields during Initialization which explains a similar example.