fork download
  1. public class Program {
  2. public static void Main() {
  3. var singleton = MyClass.Instance;
  4. }
  5. }
  6.  
  7. public class MyClass {
  8. private static MyClass instance;
  9. private MyClass() {}
  10. public static MyClass Instance {
  11. get {
  12. if (instance == null) {
  13. instance = new MyClass();
  14. }
  15. return instance;
  16. }
  17. }
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/52250/101
Success #stdin #stdout 0.01s 13988KB
stdin
Standard input is empty
stdout
Standard output is empty