fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test
  5. {
  6. public static void Value(List<int> l)
  7. {
  8. l = new List<int>(1);
  9. }
  10.  
  11. public static void Reference(ref List<int> l)
  12. {
  13. l = new List<int>(1);
  14. }
  15.  
  16. public static void Out(out List<int> l)
  17. {
  18. l = new List<int>(1);
  19. }
  20.  
  21. public static void Main()
  22. {
  23. var l = new List<int>(2);
  24. var m = new List<int>(3);
  25. var n = new List<int>(4);
  26. Value(l);
  27. Reference(ref m);
  28. Out(out n);
  29.  
  30. Console.WriteLine("{0} 2", l.Capacity);
  31. Console.WriteLine("{0} 3", m.Capacity);
  32. Console.WriteLine("{0} 4", n.Capacity);
  33.  
  34. }
  35. }
Success #stdin #stdout 0.04s 23896KB
stdin
Standard input is empty
stdout
2 2
1 3
1 4