Skip to content
Sharp

API Evolution · interview question

What will be the result of comparing two ZonedDateTime objects from different time zones but representing the same instant?

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

Correct answer

C. They are equal in terms of timeline.

Why

ZonedDateTime objects can represent the same point on the timeline even if they are in different time zones. When compared in terms of instant (timeline), they are equal.

Test yourself on API Evolution

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

Start free test
All API Evolution questions →