Value of static variable not changed even after initializing the child class in Java [duplicate]
The field y is not declared by class Checks. Reading static fields doesn’t trigger initialization of the referenced class (Checks), unless that class is the one in which the field is declared (see JLS quote below). In this example, even if y is accessed through Checks, that will only trigger the initialization of Par because … Read more