Skip to content

Instantly share code, notes, and snippets.

@walteralleyz
Created January 12, 2022 13:13
public final class Singleton {
private static Singleton instance;
public String value;
private Singleton(String value) {
this.value = value;
}
public static Singleton getInstance(String value) {
if (instance == null) {
instance = new Singleton(value);
}
return instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment