Pregunta de entrevista de Commdel

Write Singleton class via different ways

Respuestas de entrevistas

Anónimo

1 oct 2017

public sealed class Singleton { Singleton() { } private static readonly object padlock = new object(); private static Singleton instance = null; public static Singleton Instance { get { lock (padlock) { if (instance == null) { instance = new Singleton(); } return instance; } } } }

Anónimo

18 may 2017

I did it via 4 ways