November 2002
Intermediate to advanced
240 pages
5h 9m
English
When we are done with this chapter, we will have a single class to represent Money. The two implementations of times() are close, but not identical:
Franc
Money times(int multiplier) { return Money.franc(amount * multiplier); }
Dollar
Money times(int multiplier) { return Money.dollar(amount * multiplier); }
There’s no obvious way to make them identical. Sometimes you have ...