Joe Soltzberg

65%
Flag icon
If you run the program, you’ll find that you can afford three pieces of candy, and you have $0.3999999999999999 left. This is the wrong answer! The right way to solve this problem is to use BigDecimal, int, or long for monetary calculations.
Effective Java
Rate this book
Clear rating
Open Preview