- Enclosing class:
- PaymentDataManager
private static class PaymentDataManager.SingletonCreationAdmin
extends java.lang.Object
Here we will use inner class to create a singleton object of PaymentDataManager
Inner class singleton approach introduced by Bill Pugh >> singleton approaches :
- Eager initialization
- Static block initialization
- Lazy load initialization
- thread safe initialization
in this approach create the Singleton class using a inner static helper class
When the singleton class is loaded, SingletonCreationAdmin class is not loaded into memory
and only when someone calls the getInstance method.