H
Hongzheng Wang
Hi, everyone,
I'm a newbie for Java. When I read the `The Java Programming
Language', I can't understand the discussion about `cyclic
static initialization' on page 51:
What if a static initializer in class X invokes a method in Y,
but Y's static initializer invoke a method in X to set up its
static values?
.......
If cycles happen, X's static initializer will have been executed
only to the point where Y's method was invoked. When Y, in turn,
invokes the X method, that method runs with the rest oft the
static initializers yet to be executed.
I don't know the meaning of the second paragraph. Can anyone give
me a clearer explaination about it?
Thank you very much!
I'm a newbie for Java. When I read the `The Java Programming
Language', I can't understand the discussion about `cyclic
static initialization' on page 51:
What if a static initializer in class X invokes a method in Y,
but Y's static initializer invoke a method in X to set up its
static values?
.......
If cycles happen, X's static initializer will have been executed
only to the point where Y's method was invoked. When Y, in turn,
invokes the X method, that method runs with the rest oft the
static initializers yet to be executed.
I don't know the meaning of the second paragraph. Can anyone give
me a clearer explaination about it?
Thank you very much!