Last active
September 29, 2019 18:40
-
-
Save IamLizu/7dbbec1d485a035a2e746272cb99610e 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 static synchronized Singleton getInstance() { | |
// checks if instance already created | |
if (Instance == null) { | |
// if not create an instance | |
Instance = new Singleton(); | |
} | |
// return the created instance on all subsequent calls | |
return Instance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment