Skip to content

Instantly share code, notes, and snippets.



Created May 28, 2019
What would you like to do?
package doubetrouble;
import java.util.concurrent.Callable;
public class Main implements Callable<Object> {
private static class Constants {
final static Object constant;
static {
System.err.println("Lazy cosntants init");
constant = new Object();
static {
System.err.println("Main init");
public static void main(String[] args) {
try {
new Main().call();
} catch (Exception e) {
public Object call() throws Exception {
System.err.println("Main call");
return Constants.constant;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment