OffsetTime compareTo(OffsetTime other)
compares this OffsetTime to another time.
compareTo
has the following syntax.
public int compareTo(OffsetTime other)
The following example shows how to use compareTo
.
import java.time.OffsetTime; /* w w w. j av a2 s. c om*/ public class Main { public static void main(String[] args) { OffsetTime m = OffsetTime.now(); System.out.println(m.compareTo(OffsetTime.now())); } }
The code above generates the following result.