Skip to content
Sharp

API Evolution · interview question

Why do teams use java.time over java.util.Date in production code?

Multiple choiceEasychapter-12-curatedpremiumapi-evolutionmodern-date-and-time
Choose one answer
Answer and explanation

Correct answer

C. Immutability and thread safety

Why

The primary benefit of using java.time is its immutability and thread safety. These qualities reduce the likelihood of errors in concurrent applications and make the code easier to reason about.

Test yourself on API Evolution

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

Start free test
All API Evolution questions →