LocalTime equals(Object obj) example
Description
LocalTime equals(Object obj)
checks if this time is equal to another time.
Syntax
equals
has the following syntax.
public boolean equals(Object obj)
Example
The following example shows how to use equals
.
import java.time.LocalTime;
/*w ww . j a va2s .c om*/
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
System.out.println(l.equals(LocalTime.NOON));
}
}
The code above generates the following result.