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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!