Skip to content

Commit 4c40489

Browse files
authored
Merge pull request francistao#17 from eterrao/master
Fixed static Singleton pattern not be final
2 parents d1f4276 + c93422b commit 4c40489

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Part1/DesignPattern/单例模式.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public class Singleton {
9797
/**
9898
* 静态初始化器,由JVM来保证线程安全
9999
*/
100-
private static Singleton instance = new Singleton();
100+
private static final Singleton instance = new Singleton();
101101
}
102102
103103
/**

0 commit comments

Comments
 (0)