R
Roedy Green
I probably never occurs to most people to initialise static variables
in main. After all, they are all automatically initialised to 0 or to
the values in the declarations.
All works fine if you run your program only from the command line. But
if someone starts automating, and calls your main repeatedly from
Java, the second calls will get whatever static values were left over
from the first invocation of main.
in main. After all, they are all automatically initialised to 0 or to
the values in the declarations.
All works fine if you run your program only from the command line. But
if someone starts automating, and calls your main repeatedly from
Java, the second calls will get whatever static values were left over
from the first invocation of main.