I saw the following post in stack overflow which is related to my question:
BigDecimal - to use new or valueOf
I understand it is recommended to use string constructor for BigDecimal But my question is once you have defined a bigDecimal with string, can you use that value later using valueof.
Could someone let me know if the following code is valid?
BigDecimal tipPercent = new BigDecimal("0.0");
if (tipState == TipSelection.FIFTEEN) {
tipPercent = BigDecimal.valueOf(FIFTEEN);
}
Thanks!