Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This compliant solution does not spawn a background thread during class initialization.

Code Block
bgColor#ccccff

public class Lazy {
  private static boolean initialized = false;
  
  static {
    // other initialization
  }
  
  public static void main(String[] args) {
    System.out.println(initialized);
  }
}

...