Why can't we add BigDecimal to TreeSet?
I read somewhere that we cannot add BigDecimal to TreeSet because it does not correctly implement compareTo method, for example. for 9.0 and 9.00 it will return 0, although using the equals method it will return false. This seems to be the reason. Can someone explain in a little more detail?
source to share