Created
March 5, 2018 14:13
-
-
Save Norbert515/d32b3445aadf122f4a480b1c21df6707 to your computer and use it in GitHub Desktop.
singleton
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
class Repository { | |
static final Repository _repo = new Repository._internal(); | |
BookDatabase database; | |
static Repository get() { | |
return _repo; | |
} | |
Repository._internal() { | |
database = BookDatabase.get(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment