[antlr-interest] site back up

Foust javafoust at gmail.com
Wed Aug 27 13:25:21 PDT 2008


> Denis wrote:
> > Static initializers are executed when the class is initialized
> >
> > Simply referring to HomePage.class will not initialize the class.

He is, of course, correct.

Randall wrote:
> 
> That really depends on what you mean by "refer[ing] to." That value
> does not exist unless and until the class is loaded, after all. I don't
> believe it's possible to load a class that contains any compiled
> reference to a class literal in this form that does not trigger loading
> of the class in question.

The issue is that loading is separate from initialization, which isn't
required to occur until:

	a) an instance of the class is created,

	b) a non-final static member of the class is accessed, or

	c) a static method of the class is called

Brent



More information about the antlr-interest mailing list