ZoneOffset equals(Object obj) example
Description
ZoneOffset equals(Object obj)
checks if this offset is equal to another offset.
Syntax
equals
has the following syntax.
public boolean equals(Object obj)
Example
The following example shows how to use equals
.
import java.time.ZoneOffset;
/* w ww . j a v a 2 s. c o m*/
public class Main {
public static void main(String[] args) {
ZoneOffset z = ZoneOffset.UTC;
System.out.println(z.equals(ZoneOffset.UTC));
}
}
The code above generates the following result.