fork download
  1. using System;
  2. using System.Threading;
  3.  
  4. class Collectable
  5. {
  6. ~Collectable() { Console.WriteLine("goodbye, cruel world"); }
  7. }
  8.  
  9. public class Test
  10. {
  11. public static void Main()
  12. {
  13. new Collectable();
  14. GC.Collect();
  15. Thread.Sleep(500);
  16. }
  17. }
Success #stdin #stdout 0.02s 33856KB
stdin
Standard input is empty
stdout
goodbye, cruel world