When you access the
static fields of a super class on
subclass reference, only the class that declares the field will be loaded
and initialized, in this case it is
A. This is specified in JLS
§12.4.1 - When Initialization Occurs:
A reference to a
static field (§220.127.116.11) causes
initialization of only
the class or interface that actually declares it, even though it
be referred to through the name of a subclass, a subinterface,
class that implements an interface.
So in your code, class
B would not even be initialized, and
static block would not be executed.