sample code
import java.math.BigDecimal;
public class Client {
public static void main(String[] args) {
BigDecimal one = new BigDecimal("1");
BigDecimal two = new BigDecimal("1.0");
System.out.println(one.equals(two));
}
}
We enter the breakpoint at the equals method of BigDecimal and find that
The correct way is to use the compareTo method of BigDecimal
{{o.name}}
{{m.name}}