🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: Date and Time in Java: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does this print? (code)
  2. Q2. In LocalDate.of(2026, 1, 15), which month is it?
  3. Q3. What does this print? (code)
  4. Q4. You need the total number of days from today until an exam. Which is correct?
  5. Q5. Which class should hold a student's date of birth?
  6. Q6. What does the pattern letter mm mean in DateTimeFormatter?
  7. Q7. What does this print? (code)
  8. Q8. Why might a date formatted with "YYYY" show the wrong year in late December?
  9. Q9. A video call is fixed for 10:00 in India. What should you use to show the time for a friend in London?
  10. Q10. Which is true about Instant?