K
Kenny
Hello,
I'm having the problem that classes in java 1.5 do not seem to run
their static elements until the class is first used.
For example in java 1.4 simply making the Class object would cause the
static's to run:
class = a.b.c.TestClass.class
In java 1.5 this no longer happens until you do something like:
variable = a.b.c.TestClass.staticField;
The TestClass contains things like:
static public Object staticField = blah();
I've been searching for information on why this is, or how to have the
class initalize itself without having to know what type of class it is.
Can anyone offer any suggestions?
Thanks in advance,
Kenny
I'm having the problem that classes in java 1.5 do not seem to run
their static elements until the class is first used.
For example in java 1.4 simply making the Class object would cause the
static's to run:
class = a.b.c.TestClass.class
In java 1.5 this no longer happens until you do something like:
variable = a.b.c.TestClass.staticField;
The TestClass contains things like:
static public Object staticField = blah();
I've been searching for information on why this is, or how to have the
class initalize itself without having to know what type of class it is.
Can anyone offer any suggestions?
Thanks in advance,
Kenny