title: ArrayList of object references
body: <p>Having a user defined class, like this:</p>
  
  <pre><code>class Foo
      {
          public int dummy;
  
          public Foo(int dummy)
          {
              this.dummy = dummy;
          }
      }
  </code></pre>
  
  <p>And having then something like this:</p>
  
  <pre><code>ArrayList dummyfoo = new ArrayList();
  
  Foo a = new Foo(1);
  dummyfoo.add(a);
  
  foreach (Foo x in dummyfoo)
      x.dummy++;
  </code></pre>
  
  <p>How much is a.dummy?</p>
  
  <p>How can i create my ArrayList so that a.dummy equals 2, meaning that my ArrayList contains basically pointers to my objects and not copies.</p>