Skip to content
Sharp

Core Java · interview question

Why does avoiding floating-point types for monetary calculations matter in practice?

Multiple choiceEasychapter-7-curatedpremiumcore-javabigdecimal-and-money
Choose one answer
Answer and explanation

Correct answer

B. They lack precision.

Why

Floating-point types like double can introduce rounding errors due to their inability to precisely represent certain decimal values, which is problematic for monetary calculations that require exact precision.

Test yourself on Core Java

A free test with instant, explained results. No account needed.

Start free test
All Core Java questions →