Java Long.compare(long x, long y)
Syntax
Long.compare(long x, long y) has the following syntax.
public static int compare(long x, long y)
Example
In the following code shows how to use Long.compare(long x, long y) method.
/*from w w w .j av a 2s .c om*/
public class Main {
public static void main(String[] args) {
System.out.println(Long.compare(1L, 2L));
}
}
The code above generates the following result.