ZoneOffset compareTo(ZoneOffset other)
compares this offset to another offset in descending order.
compareTo
has the following syntax.
public int compareTo(ZoneOffset other)
The following example shows how to use compareTo
.
import java.time.ZoneOffset; public class Main { public static void main(String[] args) { ZoneOffset z = ZoneOffset.UTC; System.out.println(z.compareTo(ZoneOffset.UTC)); } }
The code above generates the following result.