How can I add an object to an arraylist of objects : <p>The purpose is to add teams to an arraylist. Each team is an object with a String name, String division, int wins, and int losses. </p>

<pre><code>import java.util.ArrayList;
import java.util.Arrays;
public class Default 
{
     ArrayList&lt;team&gt; teams = new ArrayList&lt;team&gt;();
     team Mavericks = new team("Mavericks","Southwest",50,32);
     team Rockets = new team("Rockets","Southwest",56,26);
     team Grizzlies = new team("Memphis","Southwest",55,27);
     teams.add(team Mavericks);
     teams.add(team Rockets);
     teams.add(team Grizzlies);
}
class team
{
    String name, division;
    int win,loss;
    public team(String n,String d, int w, int l)
    {
        this.name = n;
        this.division = d;
        this.win = w;
        this.loss = l;
    }

}
</code></pre>
