Last active
January 3, 2016 22:59
Revisions
-
ananthchelladurai revised this gist
Jan 21, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,11 @@ private SingletonBillPughExample() { // private constructor } private static class SingletonHolder { private static final SingletonBillPughExample INSTANCE = new SingletonBillPughExample(); } public static SingletonHolder getInstance() { return SingletonHolder.INSTANCE; } } -
ananthchelladurai created this gist
Jan 21, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ public class SingletonBillPughExample { private SingletonBillPughExample() { // private constructor } private static class LazyHolder { private static final SingletonBillPughExample INSTANCE = new SingletonBillPughExample(); } public static BillPughSingleton getInstance() { return LazyHolder.INSTANCE; } }