Java Reference
In-Depth Information
instance fields. Start with the
Invoice
class. An invoice aggregates
Address
and
LineItem
. Every invoice has one billing address, but it can have many line
items. To store multiple
LineItem
objects, you can use an array list. Now you
have the instance fields of the
Invoice
class:
public class Invoice
{
. . .
private Address billingAddress;
private ArrayList<LineItem> items;
}
550
551
Figure 8
The Class Documentation in HTML Format