With singletons implemented as single instances instead of static class members, you can initialize the singleton lazily, creating it only when it is first used.
由于单例对象作为实例存在而不是类的静态成员,所以你能够惰性地初始化单例对象,即只需要在第一次用它的时候才去创建它。
Initialize Static Class Members with Static Constructors.
使用静态构造器初始化静态类成员。
Initialize Static Class Members with Static Constructors.
使用静态构造器初始化静态类成员。
应用推荐