I have an arrayList of clickable balls, i don't mind them overlapping, but its a problem when they clump when clicked or when a smaller ball is obscured by a larger one. What would be the best way to sort this?
an array list of the balls ordered by size so they are drawn in order?
About floats: You define a tolerance on the values, and return zero if the absolute value of the difference of the compared values is below this tolerance (eg. 0.1 or lower for values between 1.0 and 10.0). This is because floating point calculations are inherently imprecise, so f1 == f2 is likely not to work. If not equal by this method, just return 1 or -1 with the inequality test you show above.
Imprecision comes from the way floating point numbers (which can theoretically can have an infinite number of decimal digits, see PI) are represented in the binary format. Precision is limited, so rounding errors happen.