Class Coin
java.lang.Object
|
+----Coin
- public class Coin
- extends java.lang.Object
This class keeps track of a coins name and value.
-
Coin(String, double)
- Creates a coin with given name and value.
-
equals(Coin)
- Returns true if the coin passed has the same name and value
as this coin.
-
getValue()
- Returns the value of the coin.
-
toString()
- Returns the name of the coin.
Coin
public Coin(java.lang.String theName,
double theValue)
- Creates a coin with given name and value.
- Parameters:
- theName - the name of the coin
- theValue - the value of the coin
getValue
public double getValue()
- Returns the value of the coin.
- Returns:
- returns the value of the coin
equals
public boolean equals(Coin rhs)
- Returns true if the coin passed has the same name and value
as this coin.
toString
public java.lang.String toString()
- Returns the name of the coin.
- Returns:
- returns the name of the coin
- Overrides:
- toString in class java.lang.Object