← Quiz: Date and Time in Java: all 10 questions
Quiz: Date and Time in Java · Question 5 of 10
Which class should hold a student's date of birth?
Which class should hold a student's date of birth?
- A.LocalDate
- B.Instant
- C.Duration
- D.ZonedDateTime
Answer & explanation
Correct answer: LocalDate
A birthday is a calendar date with no time and no zone, which is exactly what LocalDate stores.
Can you get the rest right without peeking?
Take the timed Quiz: Date and Time in Java quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →