[url=http://java.sun.com/developer/JDCTechTips/2003/tt0204.html#2]SOME THINGS YOU SHOULD KNOW ABOUT FLOATING-POINT ARITHMETIC[/url]
[url=http://docs.sun.com/source/806-3568/ncg_goldberg.html]What Every Computer Scientist Should Know About Floating-Point Arithmetic[/url]
Another good (slightly simpler) FP explanation:
http://mindprod.com/jgloss/floatingpoint.html
That happens sometimes. Just import the NumberFormat class (java.text.NumberFormat) create an instance of it and use the setMaximumFractionDigits() method.
It should look like this:
import java.text.NumberFormat; (at beginning)
NumberFormat i = NumberFormat.getNumberInstance();
i.setMaximumFractionDigits(2);
System.out.println(i.format(0.2 * 0.2));--or put a variable in i.format()