Skip to content
Sharp

API Evolution · interview question

How does the java.time package improve architectural design over java.util.Date?

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

Correct answer

B. By providing immutable classes

Why

The java.time package provides immutable classes, which improve thread safety and reduce the risk of unexpected changes to date/time objects. This enhances the reliability and predictability of date/time handling in applications.

Test yourself on API Evolution

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

Start free test
All API Evolution questions →