Dates and Strings
Dates and times
Invoice
Code that adds a date to the Invoice class
import java.text.*; import java.util.*; public class Invoice { private ArrayListlineItems; private Date invoiceDate; public Invoice() { lineItems = new ArrayList (); invoiceDate = DateUtils.getCurrentDate(); } public ArrayList getLineItems(){ return lineItems; } public void addItem(LineItem lineItem) { this.lineItems.add(lineItem); } public double getInvoiceTotal() { double invoiceTotal = 0; for (LineItem lineItem : this.lineItems) { invoiceTotal += lineItem.getTotal(); } return invoiceTotal; }