🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.LocalDate
  2. B.Instant
  3. C.Duration
  4. 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 →