Hello,
I was looking at some Java code and I noticed this code chunk:
static {
/* basically checks size of logfile, if bigger than 100k, then copy it as bak, and start again */
}
This is in the class file outside of methods or the constructor.
My question is, when does this static field run? When you instiate the object? When the Java JVM is loaded? When?
Thank you.
I was looking at some Java code and I noticed this code chunk:
static {
/* basically checks size of logfile, if bigger than 100k, then copy it as bak, and start again */
}
This is in the class file outside of methods or the constructor.
My question is, when does this static field run? When you instiate the object? When the Java JVM is loaded? When?
Thank you.