Question: Assume that before the following code is executed, the value of totalOne is 6.728, the value of totalTwo is 116, and both are BigDecimal objects.
Assume that before the following code is executed, the value of totalOne is 6.728, the value of totalTwo is 116, and both are BigDecimal objects. What is the value of the totalFinal after the code is executed?
totalOne = totalOne.setScale(2, RoundingMode.HALF_UP);
BigDecimal totalFinal = totalTwo.add(totalOne);
a. 122.728
b. 122.72
c. 122.73
d. 123
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
