Skip to content

Commit 5cce1f1

Browse files
author
zhupeiquan
committed
如何创建单例格式修正
1 parent abe9250 commit 5cce1f1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

contents/What_is_an_efficient_way_to_implement_a_singleton_in_Java.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public final class Foo implements Serializable {
137137
return FooLoader.INSTANCE;
138138
}
139139
}
140+
```
140141

141142
好了,现在已经很完美实现了单例的创建,是不是很高兴。单例实线的基本原理,我们已经基本清楚里,最后提供一种更加简洁方法,如下:
142143
```
@@ -150,8 +151,6 @@ public enum Foo {
150151
public static final xxx
151152
````
152153
153-
154-
155154
对于枚举的进一步理解,请参考[附录拓展](#appendix)。
156155
157156
<a id="appendix" name="appendix" />

0 commit comments

Comments
 (0)