I am reading source code about the java.sql.DriverManager,and found something confusing.Here is the code:
static {
loadInitialDrivers();
println("JDBC DriverManager initialized");
}
......
public static void println(String message) {
synchronized (logSync) {
if (logWriter != null) {
logWriter.println(message);
// automatic flushing is never enabled, so we must do it ourselves
logWriter.flush();
}
}
}
The logWriter have not been set when class initialize,but was called by its static block.So I can't see any log info about this. How can I set field value before class initialization?