|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectope.shopping.Product
public class Product
This class represents a product which has a name and a price. The product can be placed into a shopping cart.
ShoppingCart
Constructor Summary | |
---|---|
Product(java.lang.String name,
double price)
Creates a new product with the given name and price. |
Method Summary | |
---|---|
java.lang.String |
getName()
Returns the name of this product. |
double |
getPrice()
Returns the price of this product. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Product(java.lang.String name, double price)
name
- the name of this productprice
- the price of this productMethod Detail |
---|
public java.lang.String getName()
public double getPrice()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |