Skip to content

Commit 54b414a

Browse files
committed
Commented singleton example.
1 parent ed81bcf commit 54b414a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

singleton/src/main/java/com/iluwatar/App.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Singleton pattern ensures that the class (IvoryTower) can have only
6+
* one existing instance and provides global access to that instance.
7+
*
8+
*/
39
public class App
410
{
511
public static void main( String[] args )

singleton/src/main/java/com/iluwatar/IvoryTower.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Singleton class.
6+
*
7+
*/
38
public class IvoryTower {
49

510
private static IvoryTower instance = new IvoryTower();

0 commit comments

Comments
 (0)