Add item to ArrayList "recursively"
<p>I have an static ArrayList which I can only access from a class ("Sale"). In that ArrayList I want to add items of the same class. How can I add them from the constructor?</p>

<p>I've done it this way and it doesn't work:</p>

<pre><code>public class Sale{
     private static ArrayList&lt;Sale&gt; sales;
     private Buyer buyer;
     private Item item;

     public Sale(Buyer buyer, Item item){
          this.buyer=buyer;
          this.item=item;
          sales.add(this);
     }
.....
</code></pre>

<p>Thanks in advance, I'm starting programming in Java.</p>