mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-23 08:25:20 +00:00
#12 Added private constructor to ThreadSafeLazyLoadedIvoryTower.
This commit is contained in:
@@ -9,6 +9,9 @@ public class ThreadSafeLazyLoadedIvoryTower {
|
|||||||
|
|
||||||
private static ThreadSafeLazyLoadedIvoryTower instance = null;
|
private static ThreadSafeLazyLoadedIvoryTower instance = null;
|
||||||
|
|
||||||
|
private ThreadSafeLazyLoadedIvoryTower() {
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized static ThreadSafeLazyLoadedIvoryTower getInstance() {
|
public synchronized static ThreadSafeLazyLoadedIvoryTower getInstance() {
|
||||||
/*
|
/*
|
||||||
* The instance gets created only when it is called for first time.
|
* The instance gets created only when it is called for first time.
|
||||||
|
|||||||
Reference in New Issue
Block a user