何时以及如何使用构造函数
Foo bar = new Foo();
我们何时以及如何使用getInstance()(静态工厂方法)
Foo bar = Foo.getInstance();
这两者有什么区别,我总是使用第一种方式,但何时使用第二种方式?
java
java ×1