fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ConsoleApplication1
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. var list = new List<Hoge>();
  11. list.Add(new Hoge());
  12. }
  13. }
  14.  
  15. class Hoge
  16. {
  17. public Hoge()
  18. {
  19. Console.WriteLine("Hogeは生まれた");
  20. }
  21.  
  22. ~Hoge()
  23. {
  24. Console.WriteLine("Hogeは死んだ");
  25. }
  26. }
  27. }
  28.  
Success #stdin #stdout 0.02s 33888KB
stdin
Standard input is empty
stdout
Hogeは生まれた