[advanced Java interview] Why is it forbidden to use BigDecimal's equals method for equivalence comparison?

BigDecimal is a type provided by the java.math package that can be used for precise operations. For example, in scenarios such as amount representation and amount calculation, double, float and other types cannot be used, but BigDecimal with better accuracy support should be used, and many internal methods, such as addition, subtraction, mu ...

Posted by jannz on Sat, 18 Sep 2021 15:02:53 -0700

CGBTN2108-DAY12 summary review

DAY12 review 1. Regular expression Function: take the rules we specify to judge whether the data conforms to this rule Specify rule: String regex = "[0-9]{17}[0-9X]";Compare the data with the rule: input.matches(regex) – > if it matches, the matches method returns true 2. Packaging There are only two types of data types ...

Posted by lancet2003 on Sat, 18 Sep 2021 05:25:20 -0700