...
Code Block | ||
---|---|---|
| ||
public class Lazy {
private static volatile boolean initialized = false;
static {
// Initialize, for example, a database connection
initialized = true;
}
public static void main(String[] args) {
System.out.println(initialized);
}
}
|
...