Skip to content

Commit 9f829bf

Browse files
authored
Add files via upload
1 parent e3c5aa4 commit 9f829bf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Constructors/PrivateConstructor.java

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ private Person() {
1010

1111
// Factory method to provide the users with instances
1212
static public Person getInstance() {
13+
// to ensure only one instance is created
1314
if (name == null)
1415
name = new Person();
1516

0 commit comments

Comments
 (0)