Ira,
You're right that static variables are initialised at class loading time, before the rest of the code executes. At this time, the static initializers are executed - these are little bits of code surrounded by static{}
e.g
public class StaticExample
{
static
String classMember = "Static";
static{
System.out.println("StaticExample static initializer");
}
public static void classMethod(){
//Class Method
}
}
At class load time, the System.out.println will be executed and the static variable will be initialised. But the static classMethod won't run until you call it from somewhere. But you can call it using the class name
eg. StaticExample.classMethod()
without creating an instance of StaticExample - ie you don't need to do this:-
StaticExample example = new StaticExample();
example.classMethod();
The real point about static variables, methods, initializers is that you don't need to create an instance of the class to get to them. You've probably used lots of them without realising - Math.random()- a static method, BorderLayout.NORTH - a static variable, System.exit()- another static method - because they're static methods / variables, you can use them by referring to them using the class name rather than an instance of the class. And the most common static method is public static void main (String args[]) - that's your entry point into the program so no instances of classes exit when you call it - because it's static, you can call it without creating an instance of whichever class main is contained in.
Roberts et all, pages 84 onwards gives a good explanation of this and the limitations on static variables / methods.
Hope this helps,
Kathy