Created
January 12, 2022 13:13
-
-
Save walteralleyz/2952a7322fe2f499f2f2d9a62fa6c2ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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