/** The item class -- an item has a name and a price. From here we can * return the values of the attributes, and we also have toString(). */ import java.text.*; public class Item { private String name; private double price; /** Initial value constructor */ public Item(String n, double p) { name = n; price = p; } // The following 2 functions are called "accessor methods" because // they obtain information about the object, namely the value of an // attribute. public String getName() { return name; } public double getPrice() { return price; } // In this program we won't need toString, so I'm leaving it out. }