ZoneId equals(Object obj) example
Description
ZoneId equals(Object obj)
checks if this time-zone ID is equal to another time-zone ID. The comparison is based on the ID.
Syntax
equals
has the following syntax.
public boolean equals(Object obj)
Example
The following example shows how to use equals
.
import java.time.ZoneId;
/*from w w w .java 2s. c om*/
public class Main {
public static void main(String[] args) {
ZoneId z = ZoneId.systemDefault();
System.out.println(z.equals(ZoneId.systemDefault()));
}
}
The code above generates the following result.