fork(2) download
  1. using System;
  2. using System.Collections;
  3.  
  4. public class Test
  5. {
  6.  
  7. class Foo
  8. {
  9. public int dummy;
  10.  
  11. public Foo(int dummy)
  12. {
  13. this.dummy = dummy;
  14. }
  15. }
  16.  
  17. public static void Main()
  18. {
  19. ArrayList dummyfoo = new ArrayList();
  20.  
  21. Foo a = new Foo(1);
  22. dummyfoo.Add(a);
  23.  
  24. foreach (Foo x in dummyfoo)
  25. x.dummy++;
  26. foreach (Foo x in dummyfoo)
  27. Console.WriteLine(x.dummy);
  28.  
  29. }
  30. }
Success #stdin #stdout 0.04s 38016KB
stdin
Standard input is empty
stdout
2