Skip to content

Instantly share code, notes, and snippets.

@ShwetaChauhan18
Last active September 4, 2018 13:06
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 ShwetaChauhan18/884a7b0cb95e1479a4ef223573b45b5d to your computer and use it in GitHub Desktop.
Save ShwetaChauhan18/884a7b0cb95e1479a4ef223573b45b5d to your computer and use it in GitHub Desktop.
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