Another question please.
why use static to enclose a few lines of code???
e.g.
static {
...
...
}
Thanks
Steven
> Another question please.
>
[quoted text clipped - 4 lines]
> ....
> }
This is a static initializer. It is run once when the class is first
loaded, and is typically used for setting up the values of static fields.
Cheers,
Nicholas Sherlock

Signature
http://www.sherlocksoftware.org
QQ - 10 Nov 2006 01:23 GMT
Cool. thanks for your help. Steven
> > Another question please.
> >
[quoted text clipped - 10 lines]
> Cheers,
> Nicholas Sherlock
The static code block gets called the first time a class is loaded.
This addresses the age old question: when should I initialize my static
variables? In a constructor? Somewhere else?
Well, the answer is simple: in a static code block.
Cheers!
-Cameron McKenzie
Free Sun Certified Java Associate Mock Exams: www.scja.com
Free Java and J2EE Tutorials: www.mcnz.com
www.technicalfacilitation.com www.pulpjava.com www.examscam.com
> Another question please.
>
[quoted text clipped - 7 lines]
> Thanks
> Steven
QQ - 10 Nov 2006 01:24 GMT
Thank you, your answer are quite helpful for both of my questions,
really appreciate it. Steven
> The static code block gets called the first time a class is loaded.
>
[quoted text clipped - 23 lines]
> > Thanks
> > Steven