Skip to content

Instantly share code, notes, and snippets.

@walteralleyz
Created January 12, 2022 13:13
Show Gist options
  • Save walteralleyz/2952a7322fe2f499f2f2d9a62fa6c2ee to your computer and use it in GitHub Desktop.
Save walteralleyz/2952a7322fe2f499f2f2d9a62fa6c2ee to your computer and use it in GitHub Desktop.
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