Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

单例模式中itstack-demo-design-5-00 Singleton_01.java Singleton_02.java两个文件代码中均缺少instance = new Singleton_01(); instance = new Singleton_02(); 对静态成员变量的赋值代码 #58

Open
gumaomao opened this issue Apr 21, 2022 · 1 comment

Comments

@gumaomao
Copy link

在单例模式中itstack-demo-design-5-00 src/main/java/org/itstack/demo/design/Singleton_01.java Singleton_02.java两个文件代码中均缺少instance = new Singleton_01(); instance = new Singleton_02(); 对静态成员变量的赋值代码

@Shrimp-Pineapple
Copy link

这个是懒加载,程序启动类加载初始化不需要赋值,就是当需要调用该对象的时候才进行第一次赋值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants