Skip to content

Instantly share code, notes, and snippets.

@ArvinRokni
Last active June 5, 2019 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArvinRokni/d19635574bd3620b547669d4472d376d to your computer and use it in GitHub Desktop.
Save ArvinRokni/d19635574bd3620b547669d4472d376d to your computer and use it in GitHub Desktop.
class Singleton private constructor(){
companion object {
private var INSTANCE: Singleton ? = null
fun getInstance(): Singleton{
if(INSTANCE == null){
INSTANCE = Singleton()
}
return INSTANCE!!
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment