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