The Java tutorials mention this and I highly recommend going through them. In particular, this is mentioned for the float and double types:
This data type should never be used for precise values, such as currency. For that, you will need to use the java.math.BigDecimal class instead. Numbers and Strings covers BigDecimal and other useful classes provided by the Java platform.
Primitive Data Types (The Java™ Tutorials > Learning the Java Language > Language Basics)
This beginner Java tutorial describes fundamentals of programming in the Java programming language
The BigDecimal documentation is also interesting, they explain why float and double have rounding errors.
Of course, I feel just using cents or tenths of cents is a much simpler solution, as is simply rounding values, not like you’ll miss that $0.000003.