Java Language BigDecimal objects are immutable


Example

If you want to calculate with BigDecimal you have to use the returned value because BigDecimal objects are immutable:

BigDecimal a = new BigDecimal("42.23");
BigDecimal b = new BigDecimal("10.001");

a.add(b); // a will still be 42.23

BigDecimal c = a.add(b); // c will be 52.231