LocalTime equals(Object obj)
checks if this time is equal to another time.
equals
has the following syntax.
public boolean equals(Object obj)
The following example shows how to use equals
.
import java.time.LocalTime; 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.