Class Item

java.lang.Object
  |
  +--Item

public class Item
extends Object

An Item models an object that might be stocked in a store. Each Item has a cost.

Version:
4

Constructor Summary
Item(String name, int cost)
          Construct an Item object.
 
Method Summary
 int getCost()
          How much does this Item cost?
 String getName()
          What is this Item called?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Item

public Item(String name,
            int cost)
Construct an Item object.

Parameters:
name - the nme of this Item.
cost - the cost of this Item.
Method Detail

getCost

public int getCost()
How much does this Item cost?

Returns:
the cost.

getName

public String getName()
What is this Item called?

Returns:
the name.