public static void Main(string[] args) { EagerSingleton eagerSingleton = EagerSingleton.GetInstance(); Console.WriteLine(eagerSingleton.ToString()); LazySingleton lazySingleton = LazySingleton.GetInstance(); Console.WriteLine(lazySingleton.ToString()); }
private static void TestSingleton(string value) { var singleton = LazySingleton.GetInstance(value); Console.WriteLine(singleton.Value); }