Last active
September 4, 2018 13:06
-
-
Save ShwetaChauhan18/884a7b0cb95e1479a4ef223573b45b5d 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
class SingletonLazy{ | |
private static SingletonLazy mSingletonLazy; | |
private SingletonLazy(){} | |
public static SingletonLazy getSingletonLazy(){ | |
if (mSingletonLazy == null){ | |
mSingletonLazy = new SingletonLazy();//instance will be created at request time | |
} | |
return mSingletonLazy; | |
} | |
public void doSomething(){ | |
//write your code | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment