Question
Which statement about java.time API is the strongest interview answer?
- java.time API is mostly a naming style choice and has little effect on runtime or design.
- java.time API exists mainly to reduce the number of Java files in a project.
- java.time API matters only for frontend frameworks, not for core Java applications.
- The java.time API is immutable and models time concepts more clearly than the old Date and Calendar APIs.
Hint
Start with the core rule behind java.time API.
Answer and rationale
Correct answer: D. The java.time API is immutable and models time concepts more clearly than the old Date and Calendar APIs.
The java.time API is immutable and models time concepts more clearly than the old Date and Calendar APIs. This is the base concept interviewers commonly test first.
Track: Java