fork(1) download
  1. using System;
  2.  
  3. struct FieldLikeSingletonWrapper
  4. {
  5. public class FieldLikeSingleton
  6. {
  7. internal FieldLikeSingleton()
  8. {
  9. Console.WriteLine("FieldLikeSingleton.ctor");
  10. }
  11.  
  12. public void Foo()
  13. {
  14. Console.WriteLine("Foo");
  15. }
  16. }
  17.  
  18. public static FieldLikeSingleton Instance { get; } = new FieldLikeSingleton();
  19. }
  20.  
  21. class Program
  22. {
  23. static void Main(string[] args)
  24. {
  25. Console.WriteLine("Inside Main()");
  26.  
  27. if (args.Length == 42)
  28. {
  29. FieldLikeSingletonWrapper.Instance.Foo();
  30. }
  31. }
  32. }
Success #stdin #stdout 0s 29664KB
stdin
Standard input is empty
stdout
Inside Main()