Skip to main content


Showing posts with the label LocalTime

Java LocalTime Class | Date and Time API

Java LocalTime Class  Java LocalTime class is an immutable and thread-safe class introduced in new Date and Time API in Java8 and time is represented in format Hour:Minute:Seconds.Nanoseconds . For example. 04:15:15.555 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 LocalTime . LocalTime Structure public final class LocalTime extends Object implements Temporal , TemporalAdjuster , Comparable < LocalTime >, Serializable As we can see LocalTime is a final class and also immutable so we cannot inherit it and it implements  interfaces Temporal, TemporalAdjuster, LocalTime, Serializable. Introduction about the Java LocalTime class A time without a time-zone, such as 10:15:30 often viewed as hour-minute-second .  This class does not store or represent a date or time-zone. This is a value-based class, The equals method should be used for comparisons. LocalTime is an immutable