Making the constructor private and using a static getter method only, your singleton object will not be able to survive in multi-thread or multi CPU environment. We will look for a soluton to singleton usage problem in multithread environment. First attempt will be double-locking mechanism, then we will use volatile keyword to complete the task.
This is a production of www.javathlon.com.
Happy learning.
En esta página del sitio puede ver el video en línea Thread-safe singleton implementation in Java de Duración hora minuto segunda en buena calidad , que subió el usuario Java Web Development 13 octubre 2014, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 13,026 veces y le gustó 133 a los espectadores. Disfruta viendo!