proj2
Class Money
java.lang.Object
proj2.Money
public class Money
- extends java.lang.Object
The Money class implements a container for storing
nickels, dimes and quarters.
|
Constructor Summary |
Money(int nickels,
int dimes,
int quarters)
A constructor that creates a Money instance with
the specified number of nickels, dimes and quarters. |
|
Method Summary |
java.lang.String |
toString()
Returns a String representation of this Money
instance including the individual number of nickels, dimes & quarters, as
well as the total value. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Money
public Money(int nickels,
int dimes,
int quarters)
- A constructor that creates a
Money instance with
the specified number of nickels, dimes and quarters.
- Parameters:
nickels - the number of nickels.dimes - the number of dimes.quarters - the number of quarters.
toString
public java.lang.String toString()
- Returns a
String representation of this Money
instance including the individual number of nickels, dimes & quarters, as
well as the total value.
- Overrides:
toString in class java.lang.Object
- Returns:
- a string representation of the object.