classloader JVM,
1.)
2.)
( , ..
(a.) , (b.) , (c.) )
3.)
, (link) classloader ( ) ( ), - null.
Now, during the initialization phase, static variables are assigned their actual value, and a
- null
. Because the method main
will be launched after this step.
Thus, a a
value is assigned inside the main one "test"
, and is b
already assigned by the class loader during initialization, when a
it is NULL, which is why the reason String b
has a strange output.
source
share