java array assignment confusion in shopping cart
<p>I came across this java shopping cart while researching something else. I'm confused about the array created in the following:</p>

<pre><code>public class CartEntry
{
  public float Price;
  public int Quantity;
}

public class CartContents
{
  public CartEntry[] items;
}

public class Order
{
  private CartContents cart;
  private float salesTax;

  public Order(CartContents cart, float salesTax)
  {
    this.cart = cart;
    this.salesTax = salesTax;
  }

  public float OrderTotal()
  {
    float cartTotal = 0;
    for (int i = 0; i &lt; cart.items.Length; i++)
    {
      cartTotal += cart.items[i].Price * cart.items[i].Quantity;
    }
    cartTotal += cartTotal*salesTax;
    return cartTotal;
  }
}
</code></pre>

<p>The thing I'm confused about is the line:</p>

<pre><code>    public CartEntry[] items;
</code></pre>

<p>What does "item" mean? Is it a reference that points to the CartEntry array? Also, I know this is an incomplete program and I have been trying to figure out how to put it into code that I can actually call up and see the results of it. I know I would need a main method and to put some items in the array. Am I headed in the right direction? Thanks for any help!</p>
