Clock equals(Object obj)
checks if this clock is equal to another clock.
equals
has the following syntax.
public boolean equals(Object obj)
The following example shows how to use equals
.
import java.time.Clock; public class Main { public static void main(String[] args) { Clock clock = Clock.systemUTC(); Clock clock1 = Clock.systemDefaultZone(); System.out.println(clock.equals(clock1)); } }
The code above generates the following result.