-->
Skip to main content

Posts

LocalDate Java Class | Date and Time API

LocalDate Java Class  LocalDate Java class is an immutable and thread-safe class introduced in new Date and Time API in Java8 and date is represented in format YYYY-MM-dd. All classes of Java8 Date/Time API are located in java.time package and today we are going to look at one of the classes from this package that is LocalDate. LocalDate Structure 1 2 3 public final class LocalDate extends Object implements Temporal , TemporalAdjuster , ChronoLocalDate , Serializable As we can see LocalDate is a final class and also immutable so we cannot inherit it and it implements  interfaces Temporal, TemporalAdjuster, ChronoLocalDate, Serializable Introduction about the LocalDate Java class LocalDate class is immutable and thread-safe. This is a value-based class thus use of equals method is recommended for comparisons. LocalDate provides date format as YYYY-MM-dd . The LocalDate class does not have time or timezone data, So LocalDate is pr...