I have a problem with assigning one big decimal value to another
I am trying such as creating one temp big decimal and add 0 to another big decimal
BigDecimal temp = new BigDecimal(0);
dropStartValue = temp.add(newCounterValue);
However, I only want simply do the operation below on big decimals:
dropStartValue = newCounterValue
You haven’t specified the type of either
dropStartValueornewCounterValue. If they’re both BigDecimals, then this should be fine:Note that although that’s just making both variables refer to the same object, it’s safe because
BigDecimalitself is immutable.If that’s not working for you, please give details of what problems you’re seeing (exceptions? compile-time errors?).