|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectStock
public class Stock
Constructor Summary | |
---|---|
Stock(java.lang.String name,
double price)
Creates a stock with the given name and price per share. |
Method Summary | |
---|---|
java.lang.String |
getName()
Returns the stock name. |
double |
getPrice()
Returns the price per share. |
void |
setPrice(double price)
Sets the price per share. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Stock(java.lang.String name, double price)
name
- Stock nameprice
- Price per shareMethod Detail |
---|
public java.lang.String getName()
public double getPrice()
public void setPrice(double price)
price
- New price per sharepublic 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 |