title: Arraylist of classes
body: <p>Ok i need some help with a little syntax problem. I have a class and i want it to put it into an arraylist, and populate the arraylist using a for loop.
  Here is an example of what i want:</p>
  
  <pre><code>    public class w{
      int x;
      int y;
      }
      Arraylist m = new Arraylist();
      for(int i=0; i&lt;n;i++)
    {
            m[i].add(w.x);
            m[i].add(w.y);
  
    }
  </code></pre>
  
  <p>Yes the code isn't functioning its just an example of what i want it to do. I don't know the syntax and I want an arraylist with classes that can be retrieved by giving the i and get the both variables only by that 'i';
  Any help will be apreciated. Thank you very much for your time, sorry for the lousy description but i can't be more specific. </p>