static?
I encountered this bit of code in a project I am working on:
static{
load();
}
It is declared like a method in a class, and I tried to google about it but came up empty. When is load called? The class only contains static variables and methods.
[360 byte] By [
johan.ga] at [2007-11-26 18:39:43]

> I encountered this bit of code in a project I am
> working on:
>
> [code]
> static{
> load();
> e]
>
> It is declared like a method in a class, and I tried
> to google about it but came up empty
>. When is load
> called?
When the classloader first loads the class containing that block. The class will be first loaded when an instance of that class is first created or when any static member of that class is first called.
The name of the thing is "static initializer block", which I guess is googlable (I know Google is opposed to making google, googlable etc. into words in the language, but they're not to decide that).