RosettaCodeData/Task/Singleton/C-sharp/singleton-4.cs

12 lines
314 B
C#
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
public sealed class Singleton4 //Lazy: Yes ||| Thread-safe: Yes ||| Uses locking: No
{
public static Singleton4 Instance => SingletonHolder.instance;
private class SingletonHolder
{
static SingletonHolder() { }
internal static readonly Singleton4 instance = new Singleton4();
}
}