Lab 13
Interfaces
2008-07-23

Objects define their interaction with the outside world through the methods that they expose. Methods form the object's interface with the outside world.

In its most common form, an interface is a group of related methods with empty bodies. Any item in an inventory might be listed in a report, and this behavior, if specified as an interface, might appear as in Reportable.java .

Implementing an interface allows a class to become more formal about the behavior it promises to provide. Interfaces form a contract between the class and the outside world, and this contract is enforced at build time by the compiler. If your class claims to implement an interface, all methods defined by that interface must appear in its source code before the class will successfully compile.

Augment the following classes so that they implement the Reportable interface:

and so that the following output is produced when Driver.java executes.
atlas{eileen}83: java Driver
Quick Listing of Items in Inventory:
apples
grapes
Mac and Cheese
Soup Mix
Captain Crunch


Detailed Listing of Items in Inventory:
apples : red , 5.0
grapes : green , 3.0
Mac and Cheese : 12 per case. 
Soup Mix : 6 per case. 
Captain Crunch : 24 per case.