## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

## Chapter 10. Interesting Times

 \$5 + 10 CHF = \$10 if rate is 2:1\$5 * 2 = \$10Make “amount” privateDollar side effects?Money rounding?equals()hashCode()Equal nullEqual object5 CHF * 2 = 10 CHFDollar/Franc duplicationCommon equalsCommon timesCompare Francs to DollarsCurrency?Delete testFrancMultiplication?

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 to go backward to go forward, a little like solving ...

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required