Java: Modern Date and Time
Why does the difference between Duration and Period matter in practice?
Duration measures time-based amounts in seconds and nanoseconds, Period in years, months, days. Use Duration for precise time…
View Card →Quick study sessions to strengthen memory and retain key concepts.
Why does the difference between Duration and Period matter in practice?
Duration measures time-based amounts in seconds and nanoseconds, Period in years, months, days. Use Duration for precise time…
View Card →How does java.time handle time zones with ZonedDateTime?
ZonedDateTime combines LocalDateTime with ZoneId for timezone-specific timestamps. ZonedDateTime allows you to represent date and time with a…
View Card →Why use java.time.Instant over java.util.Date?
Instant is immutable and thread-safe, representing a point in time in UTC. Instant provides a cleaner API for…
View Card →How would you explain the safest modernization strategy in an interview?
Modernize one verified seam at a time while keeping public contracts stable. Incremental refactors are easier to review…
View Card →Why is exhaustive compiler checking valuable?
A new variant forces the code to be updated everywhere that must handle it. When a sealed hierarchy…
View Card →How would you explain a verified seam in modernization in an interview?
A small, well-understood area whose behavior is already clear and testable. DTOs, value objects, localized switches, and date…
View Card →