We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1c916d commit 80bb0f5Copy full SHA for 80bb0f5
snippets/designpattern.json
@@ -3,11 +3,12 @@
3
"prefix": "singleton",
4
"body": [
5
"// class Singleton {",
6
- "//\t\tprivate static Singleton _instance",
+ "//\t\tprivate static Singleton _instance = null;",
7
"//\t\tpublic static Singleton GetInstance() {",
8
"//\t\t\tif (_instance == null) {",
9
"//\t\t\t\t_instance = new Singleton();",
10
- "// return _instance;",
+ "//\t\treturn _instance;",
11
+ "//\t\t}",
12
"//}"
13
],
14
"description": "Creational design pattern singleton"
@@ -134,4 +135,4 @@
134
135
136
"description": "Behavioral design pattern observer"
137
}
-}
138
+}
0 commit comments